summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2024-02-14 10:55:56 +0100
committeremkael <emkael@tlen.pl>2024-02-14 10:55:56 +0100
commiteb6a3fd194c9cfdd676b231608e4d33d0c3e4cd9 (patch)
tree005f005a7cb39700c655714a8ac3b19d5b328e70
parentbf166b0533cd527e1d9665ad6efc6d11d0e3a27e (diff)
Compatibility with new, longer TC result link hashes
-rw-r--r--jfr_playoff/data/match/tcjson.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/jfr_playoff/data/match/tcjson.py b/jfr_playoff/data/match/tcjson.py
index 590f27d..2bd6a2c 100644
--- a/jfr_playoff/data/match/tcjson.py
+++ b/jfr_playoff/data/match/tcjson.py
@@ -22,7 +22,11 @@ class TCJsonMatchInfo(MatchInfoClient):
def _get_round_from_link(self, link):
fragment = urlparse.urlparse(link).fragment
- return max(1, int(fragment[11:14])), max(1, int(fragment[14:17]))
+ if len(fragment) < 28:
+ # old, shorter TC hashes
+ return int(fragment[11:14]), int(fragment[14:17])
+ # new, longer TC hashes
+ return int(fragment[20:26]), int(fragment[26:32])
def get_match_link(self):
PlayoffLogger.get('match.tcjson').info(