From eddfcbf7f775d56058eaf8e438bc1dee5a42e8bc Mon Sep 17 00:00:00 2001 From: Ching Date: Sun, 12 May 2024 01:10:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20openapi=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8A=A5=E9=94=99=E6=97=B6=EF=BC=8C=E6=88=98=E7=BB=A9?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=BA=E7=A9=BA=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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dota.py b/dota.py index 479389d..73b0b77 100644 --- a/dota.py +++ b/dota.py @@ -124,7 +124,12 @@ class Friend(BaseModel): if limit > 10: limit = 10 for friend in friends: - matches.extend(friend.serialize_recent_matches(limit=limit)) + matches_ = friend.serialize_recent_matches(limit=limit) + if not matches_: + continue + matches.extend(matches_) + if not matches: + return None # sort matches by start_time from latest to oldest matches.sort(key=lambda x: x['start_time'], reverse=True) name = friends[0].name