From 07ff5ac055eb787d0af8e544d3a9a9708e54d17a Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Wed, 21 Feb 2024 18:40:21 -0500 Subject: [PATCH] feat: Push the games that are in intermission to the bottom, but retain their sort --- app/scoreboard/process_data.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index aab6253..dc35993 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -76,7 +76,7 @@ def get_game_outcome(game, game_state): def calculate_game_priority(game): # Return 0 if game is in certain states - if game["gameState"] in ["FINAL", "OFF", "PRE", "FUT"] or game["clock"]["inIntermission"]: + if game["gameState"] in ["FINAL", "OFF", "PRE", "FUT"]: return 0 # Get standings for home and away teams @@ -121,6 +121,10 @@ def calculate_game_priority(game): # Calculate the final priority final_priority = int(base_priority + time_priority - matchup_adjustment + score_total) + # Pushes the games that are in intermission to the bottom, but retains their sort + if game["clock"]["inIntermission"]: + return (final_priority - 2000) + return final_priority def get_team_standings(team_name):