From e5824cefc5ebdbf8218e68ce6767915fa2fa2c37 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 00:11:22 -0500 Subject: [PATCH 1/5] fix: sort games in intermission by time left --- app/scoreboard/process_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 761bbef..6af9121 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -124,7 +124,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 From dfb86f6fd558cc0269ca8904106c9f77b28143f5 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 00:14:14 -0500 Subject: [PATCH 2/5] changes hype meter scale to 600 instead of 700 --- app/static/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/static/script.js b/app/static/script.js index 032d8e1..3dd19c1 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(600, Math.max(0, score)); // Calculate the gauge width as a percentage - var gaugeWidth = (score / 700) * 100; + var gaugeWidth = (score / 600) * 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' From 6ec9a7aef12fd1efa9bb1ca74d5271fab4547635 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 00:14:39 -0500 Subject: [PATCH 3/5] fix: lower weight of total score --- app/scoreboard/process_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 6af9121..9993e10 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"]) From 3edb84c3338f7433238a17054000e422ab2571e3 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 01:16:31 -0500 Subject: [PATCH 4/5] fix: change scale to 650 instead of 600 --- app/static/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/script.js b/app/static/script.js index 3dd19c1..1811f48 100644 --- a/app/static/script.js +++ b/app/static/script.js @@ -95,10 +95,10 @@ function updateGauge() { var score = parseInt(gauge.getAttribute('data-score')); // Clamp the score value between 0 and 700 - score = Math.min(600, Math.max(0, score)); + score = Math.min(650, Math.max(0, score)); // Calculate the gauge width as a percentage - var gaugeWidth = (score / 600) * 100; + var gaugeWidth = (score / 650) * 100; // Set the width of the gauge gauge.style.width = gaugeWidth + '%'; From 94f9cced2e80c44770f2f6b9e597e46d03c6be7a Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 01:17:13 -0500 Subject: [PATCH 5/5] game priority: double differential adjustment at 5 minutes left in third --- app/scoreboard/process_data.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 9993e10..2c2949b 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -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: