fix(dota.py): 修复 party_size 为 None 导致序列化报错的问题
修复 party_size 为 None 导致序列化报错的问题 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
f0254be67c
commit
42b000fe89
4
dota.py
4
dota.py
@ -130,8 +130,10 @@ class Friend(BaseModel):
|
|||||||
}
|
}
|
||||||
for match_ in matches[:limit]:
|
for match_ in matches[:limit]:
|
||||||
duration = '%d:%02d:%02d' % utils.convert_seconds_to_hms(match_['duration'])
|
duration = '%d:%02d:%02d' % utils.convert_seconds_to_hms(match_['duration'])
|
||||||
if match_['party_size'] > 1:
|
if match_['party_size'] and match_['party_size'] > 1:
|
||||||
summary = f"{match_['party_size']}黑 {duration}"
|
summary = f"{match_['party_size']}黑 {duration}"
|
||||||
|
elif match_['party_size'] == None:
|
||||||
|
summary = f"??黑 {duration}"
|
||||||
else:
|
else:
|
||||||
summary = f"单排 {duration}"
|
summary = f"单排 {duration}"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user