summaryrefslogtreecommitdiff
path: root/jfr_playoff/tournamentinfo
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/tournamentinfo')
-rw-r--r--jfr_playoff/tournamentinfo/tcjson.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/jfr_playoff/tournamentinfo/tcjson.py b/jfr_playoff/tournamentinfo/tcjson.py
index 039a9b0..775183e 100644
--- a/jfr_playoff/tournamentinfo/tcjson.py
+++ b/jfr_playoff/tournamentinfo/tcjson.py
@@ -36,7 +36,15 @@ class TCJsonTournamentInfo(TournamentInfoClient):
results = []
results_json = json.loads(
p_remote.fetch_raw(self.get_results_link('results.json')))
+ participant_groups = []
for result in results_json['Results']:
+ group = result['ParticipantGroup']
+ if group is not None:
+ if group not in participant_groups:
+ participant_groups.append(group)
+ group_id = participant_groups.index(group) + 1
+ else:
+ group_id = 999999
participant = result['Participant']
flag_url = None
flag = participant['_flag']
@@ -46,7 +54,7 @@ class TCJsonTournamentInfo(TournamentInfoClient):
if flag['IsCustom']
else '%s/%s.png' % (FLAG_CDN_URL, flag['CountryNameCode']))
results.append((
- result['ParticipantGroup'], result['Place'],
+ group_id, result['Place'],
participant['_name'], participant['_shortName'],
flag_url))
PlayoffLogger.get('tcjson').info(