From fedb24ffa01c7c48d445297774914c1f47245eae Mon Sep 17 00:00:00 2001 From: MoYoez Date: Wed, 23 Aug 2023 22:53:18 +0800 Subject: [PATCH] add more commit on reply --- app.py | 4 ++-- method.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 411d1fb..8b71936 100644 --- a/app.py +++ b/app.py @@ -68,9 +68,9 @@ def get_songs(): if diff is None: diff = "IN" try: - Contents = BestsRender.get_songs_stats(session, songs, diff) + Contents, msg = BestsRender.get_songs_stats(session, songs, diff) if Contents is None: - data = {"status": False, "message": "SongID or Diff Not found"} + data = {"status": False, "message": msg} else: get_formatData = BestsRender.get_formatData(session) Contents = {"record": Contents} diff --git a/method.py b/method.py index d283a88..65474eb 100644 --- a/method.py +++ b/method.py @@ -142,10 +142,10 @@ def get_songs_stat_main(gameRecord, songid, diff): record = reader.readRecord(songId) if songId == songid: if record[0]["level"] == getdiff: - return record[0] + return record[0], None else: continue - return None + return None, "No Records Found , check songid is correct or the record is existed?" class BestsRender: @@ -259,6 +259,8 @@ def get_songs_stats(session, songid, diff): headers=headers, ) result = response.json()["results"][0]["gameFile"]["url"] + if result == None: + return None, "No Game Record" gameRecord = DataPackage.GameReader(result) gameRecord = decrypt_gameRecord(gameRecord) return get_songs_stat_main(gameRecord, songid, diff)