diff options
author | emkael <emkael@tlen.pl> | 2024-02-14 10:23:27 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2024-02-14 10:23:27 +0100 |
commit | bf166b0533cd527e1d9665ad6efc6d11d0e3a27e (patch) | |
tree | 2461a4e1fbc382f2c605c74cb06f960b1dd11b84 | |
parent | 1f8bc9d4faf8c3be01303805c3029835555a676a (diff) |
Auto-detecting how home and away team results are represented in TC JSON
-rw-r--r-- | jfr_playoff/data/match/tcjson.py | 3 |
1 files changed, 2 insertions, 1 deletions
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] |