From fd24fc01f7d52aa50ebe7e5c61e6da2fce38e4e5 Mon Sep 17 00:00:00 2001 From: Ching Date: Sun, 12 May 2024 11:57:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=BC=80=E9=BB=91=E6=95=B0=E6=8D=AE=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dota.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dota.py b/dota.py index ec7a77e..03c8f90 100644 --- a/dota.py +++ b/dota.py @@ -139,12 +139,12 @@ class Friend(BaseModel): } for match_ in matches[:limit]: duration = '%d:%02d:%02d' % utils.convert_seconds_to_hms(match_['duration']) + summary = f"{duration}" if match_['party_size'] == None: if Match.filter(match_id=match_['match_id']).exists(): match_['party_size'] = Match.get(match_id=match_['match_id']).party_size - else: + if match_['party_size']: match_['party_size'] = 0 - summary = f"{duration}" if match_['party_size'] and match_['party_size'] > 1: summary = f"{match_['party_size']}黑 {duration}" elif match_['party_size'] and match_['party_size'] == 1: @@ -228,12 +228,12 @@ def serialize_match_for_discord(match_): is_radiant = player['is_radiant'] break win = is_radiant == match_['radiant_win'] + summary = f"{match_['duration']}" if not match_['party_size']: if Match.filter(match_id=match_['match_id']).exists(): match_['party_size'] = Match.get(match_id=match_['match_id']).party_size else: match_['party_size'] = 0 - summary = f"{match_['duration']}" if match_['party_size'] > 1: summary = f"{match_['party_size']}黑 {match_['duration']}" elif match_['party_size'] == 1: