Merge branch 'fix_quake' into 'master'

Fixing edge case with finding last game type played

See merge request ldooks/dragon-bot!13
This commit is contained in:
Luke 2018-07-10 20:05:25 +00:00
commit 17074848bc

View File

@ -163,7 +163,7 @@ def get_match_stats(blob, target_player):
"""
# Figure out which ranked gametype they last played
game_type = [x for x in blob['playerRatings'] if blob['playerRatings'][x]['lastChange'] != 0][0]
game_type = 'tdm' if blob['playerRatings']['tdm']['lastUpdated'] < blob['playerRatings']['duel']['lastUpdated'] else 'duel'
most_recent_match_id = blob['playerRatings'][game_type]['history'][0]['sessionId']
match_endpoint = "Player/Games?id={}".format(most_recent_match_id)