summaryrefslogtreecommitdiff
path: root/jfr_playoff/data
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/data')
-rw-r--r--jfr_playoff/data/tournament/jfrdb.py2
-rw-r--r--jfr_playoff/data/tournament/jfrhtml.py16
-rw-r--r--jfr_playoff/data/tournament/tcjson.py4
3 files changed, 19 insertions, 3 deletions
diff --git a/jfr_playoff/data/tournament/jfrdb.py b/jfr_playoff/data/tournament/jfrdb.py
index 6317a79..2607e88 100644
--- a/jfr_playoff/data/tournament/jfrdb.py
+++ b/jfr_playoff/data/tournament/jfrdb.py
@@ -59,7 +59,7 @@ class JFRDbTournamentInfo(TournamentInfoClient):
PlayoffLogger.get('tournament.jfrdb').warning(
SWISS_TIE_WARNING, self.settings['database'])
prev_result = team[1]
- db_teams = [[team[0], team[3], team[4]] for team in swiss_results]
+ db_teams = [[team[0], team[3], team[4], None, None, team[1]] for team in swiss_results]
PlayoffLogger.get('tournament.jfrdb').info(
'fetched team list from database %s: %s',
self.settings['database'], db_teams)
diff --git a/jfr_playoff/data/tournament/jfrhtml.py b/jfr_playoff/data/tournament/jfrhtml.py
index ac57d4c..f42595a 100644
--- a/jfr_playoff/data/tournament/jfrhtml.py
+++ b/jfr_playoff/data/tournament/jfrhtml.py
@@ -1,3 +1,4 @@
+from decimal import Decimal
from math import ceil
import re
@@ -79,6 +80,21 @@ class JFRHtmlTournamentInfo(TournamentInfoClient):
team_image = team.find('img')
if team_image is not None:
team_info.append(team_image['src'].replace('images/', ''))
+ else:
+ team_info.append(None)
+ # make room for final positionswhich would otherwise be defined in config
+ team_info.append(None)
+ # fetch score for carry-over purposes
+ score_td = team
+ while score_td is not None and score_td.name != 'td':
+ score_td = score_td.parent
+ if score_td is None:
+ PlayoffLogger.get('tournament.jfrhtml').info(
+ 'something went wrong, could not find parent cell table for team: %s', team_info)
+ score_td = score_td.find_next_sibling('td', class_='bdc')
+ PlayoffLogger.get('tournament.jfrhtml').debug(
+ 'score cell for team: %s', score_td)
+ team_info.append(Decimal(score_td.text.strip()))
teams.append(team_info)
PlayoffLogger.get('tournament.jfrhtml').info(
'read tournament results from leaderboard: %s', teams)
diff --git a/jfr_playoff/data/tournament/tcjson.py b/jfr_playoff/data/tournament/tcjson.py
index 8d7cd34..c84c27f 100644
--- a/jfr_playoff/data/tournament/tcjson.py
+++ b/jfr_playoff/data/tournament/tcjson.py
@@ -63,7 +63,7 @@ class TCJsonTournamentInfo(TournamentInfoClient):
results.append((
group_id, result['Place'],
participant['_name'], participant['_shortName'],
- flag_url))
+ flag_url, None, result['Result']['_pointsDecimal']))
PlayoffLogger.get('tournament.tcjson').info(
'tournament results fetched: %s' % results)
- return [list(r[2:]) + [None] for r in sorted(results)]
+ return [list(r[2:]) for r in sorted(results)]