From bf166b0533cd527e1d9665ad6efc6d11d0e3a27e Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 14 Feb 2024 10:23:27 +0100 Subject: Auto-detecting how home and away team results are represented in TC JSON --- jfr_playoff/data/match/tcjson.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'jfr_playoff') diff --git a/jfr_playoff/data/match/tcjson.py b/jfr_playoff/data/match/tcjson.py index 41ee4d8..590f27d 100644 --- a/jfr_playoff/data/match/tcjson.py +++ b/jfr_playoff/data/match/tcjson.py @@ -49,7 +49,8 @@ class TCJsonMatchInfo(MatchInfoClient): def fetch_teams(self, teams): results = self._get_results( self.settings['link'], self.settings['table']) - for idx, side in enumerate(['Ns', 'Ew']): + sides = [side for side in ['Ns', 'Sn', 'We', 'Ew'] if side in results] + for idx, side in enumerate(sides): teams[idx].name = [results[side]['_name']] teams[idx].known_teams = 1 teams[idx].score = results['Sum1'+side] -- cgit v1.2.3