fix(dota.py): 当接口没有返回 party size 的时候通过数据库中的 Friend 数据进行比对
当接口没有返回 party size 的时候通过数据库中的 Friend 数据进行比对 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
61566c20e1
commit
fa6bef2c73
3
dota.py
3
dota.py
@ -66,6 +66,9 @@ class Match(BaseModel):
|
|||||||
'party_size': self.party_size,
|
'party_size': self.party_size,
|
||||||
'match_id': self.match_id,
|
'match_id': self.match_id,
|
||||||
}
|
}
|
||||||
|
if not self.party_size:
|
||||||
|
player_account_ids = [player.account_id for player in match_.players if player.account_id]
|
||||||
|
match_data['party_size'] = Friend.select().where(Friend.steam_id.in_(player_account_ids)).count()
|
||||||
return match_data
|
return match_data
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user