From 6762fb4bd2b02048a5657b0f2c68b279fdd48176 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 25 Feb 2017 18:44:50 +0100 Subject: Towel support --- playoff.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'playoff.py') diff --git a/playoff.py b/playoff.py index ec0bb37..6169f5e 100644 --- a/playoff.py +++ b/playoff.py @@ -155,13 +155,14 @@ def get_match_info(match): ) if len([team for team in teams if team is not None]) > 0 else '' try: + towels = db_fetch(match['database'], p_sql.TOWEL_COUNT, (match['table'], match['round'])) row = db_fetch(match['database'], p_sql.BOARD_COUNT, (match['table'], match['round'])) if row[1] > 0: info.running = int(row[1]) - if row[1] == row[0]: - info.running = 0 - info.winner = info.teams[0].name if info.teams[0].score > info.teams[1].score else info.teams[1].name - info.loser = info.teams[1].name if info.teams[0].score > info.teams[1].score else info.teams[0].name + if row[1] >= row[0] - towels[0]: + info.running = 0 + info.winner = info.teams[0].name if info.teams[0].score > info.teams[1].score else info.teams[1].name + info.loser = info.teams[1].name if info.teams[0].score > info.teams[1].score else info.teams[0].name except Exception as e: pass return info -- cgit v1.2.3