From 540dcfb0300ec31919b14d31bed84a7bfaeab78f Mon Sep 17 00:00:00 2001 From: MichaƂ Klichowicz Date: Wed, 4 Oct 2023 23:37:41 +0200 Subject: Detecting tables in PBN that are not in Teamy event (probably a very bad situation) --- src/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.py b/src/main.py index 05d6b02..111cc39 100644 --- a/src/main.py +++ b/src/main.py @@ -89,6 +89,9 @@ def fetch_lineups(pbn, db, settings): for t, rooms in tables.items(): table = get_digits(t) + if table not in round_lineup: + logging.error('[Table "%s"] not in tournament for round %s-%s', table, settings['teamy_round'], settings['teamy_segment']) + continue home_team = round_lineup[table][0] away_team = round_lineup[table][1] home_roster = rosters[home_team] @@ -266,6 +269,7 @@ def update_auction(db, pbn_board, round_no, segment_no, table, room, board_no, r def fetch_scores(pbn, db, settings): + round_lineup = get_round_lineup(db, settings['teamy_round'], settings['teamy_segment']) board_mapping = get_board_mapping(db, settings['teamy_round'], settings['teamy_segment']) for b in pbn.boards: if b.has_field('Round'): @@ -277,10 +281,16 @@ def fetch_scores(pbn, db, settings): board, settings['teamy_round'], settings['teamy_segment']) continue + board_no = board_mapping[board] + table = get_digits(b.get_field('Table')) room = 1 if b.get_field('Room') == 'Open' else 2 + if table not in round_lineup: + logging.error('[Table "%s"] not in tournament for round %s-%s', table, settings['teamy_round'], settings['teamy_segment']) + continue + update_score(db, b, settings['teamy_round'], settings['teamy_segment'], table, room, board_no, real_board_no=board, overwrite=settings['overwrite_scores']) -- cgit v1.2.3