diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 761bbef..2c2949b 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -85,7 +85,7 @@ def calculate_game_priority(game): home_score = game["homeTeam"]["score"] away_score = game["awayTeam"]["score"] score_difference = abs(home_score - away_score) - score_total = (home_score + away_score) * 25 + score_total = (home_score + away_score) * 20 # Get standings for home and away teams home_team_standings = get_team_standings(game["homeTeam"]["name"]["default"]) @@ -103,12 +103,19 @@ def calculate_game_priority(game): base_priority = {5: 650, 4: 600, 3: 300, 2: 200}.get(period, 100) # Adjust base priority based on score difference + score_differential_adjustment = 0 + if score_difference > 3: - base_priority -= 500 + score_differential_adjustment += 500 elif score_difference > 2: - base_priority -= 350 + score_differential_adjustment += 350 elif score_difference > 1: - base_priority -= 100 + score_differential_adjustment += 100 + + if period == 3 and time_remaining <= 300: + score_differential_adjustment = score_differential_adjustment * 2 + + base_priority -= score_differential_adjustment # Adjust base priority based on certain conditions if score_difference == 0 and period == 3 and time_remaining <= 600: @@ -124,7 +131,7 @@ def calculate_game_priority(game): # Pushes the games that are in intermission to the bottom, but retains their sort if game["clock"]["inIntermission"]: - return (final_priority - 2000) + return (-2000 - time_remaining) return final_priority diff --git a/app/static/script.js b/app/static/script.js index 032d8e1..1811f48 100644 --- a/app/static/script.js +++ b/app/static/script.js @@ -95,17 +95,17 @@ function updateGauge() { var score = parseInt(gauge.getAttribute('data-score')); // Clamp the score value between 0 and 700 - score = Math.min(700, Math.max(0, score)); + score = Math.min(650, Math.max(0, score)); // Calculate the gauge width as a percentage - var gaugeWidth = (score / 700) * 100; + var gaugeWidth = (score / 650) * 100; // Set the width of the gauge gauge.style.width = gaugeWidth + '%'; - if (score <=350) { + if (score <=300) { gauge.style.backgroundColor = '#4A90E2' - } else if (score <= 560) { + } else if (score <= 500) { gauge.style.backgroundColor = '#FF4500' } else { gauge.style.backgroundColor = '#FF0033'