Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c8f535ee48 | |||
| 7e41cf4781 | |||
| 2e85ced6ce | |||
| 085514ab16 | |||
| 04e29469dd | |||
| 982fdfb3c1 | |||
| 18ff48cc2c | |||
| 9f4a6c966a |
@@ -108,11 +108,11 @@ def calculate_game_priority(game):
|
||||
away_total = away_team_standings["league_sequence"] + away_team_standings["league_l10_sequence"]
|
||||
|
||||
# Calculate the matchup adjustment factor
|
||||
matchup_multiplier = {5: 1, 4: 1, 3: 1.50, 2: 1.65, 1: 2}.get(period)
|
||||
matchup_multiplier = {5: 1, 4: 1, 3: 1.25, 2: 1.50, 1: 2}.get(period)
|
||||
matchup_adjustment = (home_total + away_total) * matchup_multiplier
|
||||
|
||||
# Calculate the base priority based on period
|
||||
base_priority = {5: 650, 4: 600, 3: 300, 2: 200}.get(period, 150)
|
||||
base_priority = {5: 650, 4: 600, 3: 300, 2: 200}.get(period, 100)
|
||||
|
||||
# Adjust base priority based on score difference
|
||||
score_differential_adjustment = 0
|
||||
@@ -130,29 +130,14 @@ def calculate_game_priority(game):
|
||||
base_priority -= score_differential_adjustment
|
||||
|
||||
# Adjust base priority based on certain conditions
|
||||
if period == 3 and time_remaining <= 720:
|
||||
if score_difference == 0:
|
||||
base_priority += 100
|
||||
elif score_difference == 1:
|
||||
base_priority += 60
|
||||
|
||||
if period == 3 and time_remaining <= 360:
|
||||
if score_difference == 0:
|
||||
base_priority += 50
|
||||
elif score_difference == 1:
|
||||
base_priority += 30
|
||||
|
||||
if score_difference == 0 and period == 3 and time_remaining <= 600:
|
||||
base_priority += 100
|
||||
|
||||
# Calculate time priority
|
||||
time_multiplier = {4: 2, 3: 2, 2: 1.5}.get(period, 0.75)
|
||||
|
||||
time_priority = ((1200 - time_remaining) / 20) * time_multiplier
|
||||
|
||||
print(base_priority)
|
||||
print(time_priority)
|
||||
print(matchup_adjustment)
|
||||
print(score_total)
|
||||
|
||||
# Calculate the final priority
|
||||
final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)
|
||||
|
||||
@@ -176,6 +161,6 @@ def get_team_standings(team_name):
|
||||
|
||||
def utc_to_est_time(utc_time):
|
||||
utc_datetime = datetime.strptime(utc_time, "%Y-%m-%dT%H:%M:%SZ")
|
||||
est_offset = timedelta(hours=-4)
|
||||
est_offset = timedelta(hours=-5)
|
||||
est_datetime = utc_datetime + est_offset
|
||||
return est_datetime.strftime("%#I:%M %p")
|
||||
|
||||
@@ -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 <=300) {
|
||||
gauge.style.backgroundColor = '#4A90E2'
|
||||
} else if (score <= 550) {
|
||||
} else if (score <= 500) {
|
||||
gauge.style.backgroundColor = '#FF4500'
|
||||
} else {
|
||||
gauge.style.backgroundColor = '#FF0033'
|
||||
@@ -166,11 +166,8 @@ function generateGameBoxes(games, state) {
|
||||
else if (game['Period'] == 3 ) {
|
||||
html += '3rd';
|
||||
}
|
||||
else if (game['Period'] == 4 ) {
|
||||
html += 'OT';
|
||||
}
|
||||
else {
|
||||
html += 'SO';
|
||||
html += 'OT';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="live-time">' + game['Time Remaining'] + '</div>';
|
||||
|
||||
Reference in New Issue
Block a user