From 97f125c55e38246515da04de19b4f3ec343b5705 Mon Sep 17 00:00:00 2001 From: kevroded Date: Wed, 6 Jan 2021 01:05:37 -0500 Subject: [PATCH] Moved db statement to remove duplicate saves --- main_controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main_controller.py b/main_controller.py index 6f7a3a7..31efe82 100644 --- a/main_controller.py +++ b/main_controller.py @@ -64,16 +64,18 @@ def update_loop(): if state["update_pause"] == 1: state["update_emoji"] = "🍿" if this_game.over: - db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score, this_game.weather.name) state["display_inning"] -= 1 state["display_top_of_inning"] = False winning_team = this_game.teams['home'].name if this_game.teams['home'].score > this_game.teams['away'].score else this_game.teams['away'].name if this_game.victory_lap and winning_team == this_game.teams['home'].name: state["update_text"] = f"{winning_team} wins with a victory lap!" + db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score, this_game.weather.name) elif winning_team == this_game.teams['home'].name: state["update_text"] = f"{winning_team} wins, shaming {this_game.teams['away'].name}!" + db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score, this_game.weather.name) else: state["update_text"] = f"{winning_team} wins!" + db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score, this_game.weather.name) state["pitcher"] = "-" state["batter"] = "-" elif this_game.top_of_inning: