Skip to content

Commit

Permalink
add more commit on reply
Browse files Browse the repository at this point in the history
  • Loading branch information
MoYoez committed Aug 23, 2023
1 parent 5e0e008 commit fedb24f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 4 additions & 2 deletions method.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

0 comments on commit fedb24f

Please sign in to comment.