Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bac025624 | |||
| 0d3921e7cf | |||
| f17e221ad3 | |||
| 1c2028fa85 | |||
| 9fe94057ff | |||
| e355693613 | |||
| 468a03e646 | |||
| d89d674b2a | |||
| 7b5bde447a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@
|
|||||||
/__pycache__
|
/__pycache__
|
||||||
/app/__pycache__
|
/app/__pycache__
|
||||||
/app/scoreboard/__pycache__
|
/app/scoreboard/__pycache__
|
||||||
|
nhl_standings.db
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ def calculate_game_priority(game):
|
|||||||
home_score = game["homeTeam"]["score"]
|
home_score = game["homeTeam"]["score"]
|
||||||
away_score = game["awayTeam"]["score"]
|
away_score = game["awayTeam"]["score"]
|
||||||
score_difference = abs(home_score - away_score)
|
score_difference = abs(home_score - away_score)
|
||||||
score_total = (home_score + away_score) * 20
|
score_total = (home_score + away_score) * 25
|
||||||
|
|
||||||
# Calculate the base priority based on period
|
# Calculate the base priority based on period
|
||||||
base_priority = {4: 400, 3: 300, 2: 200}.get(period, 100)
|
base_priority = {5: 450, 4: 400, 3: 300, 2: 200}.get(period, 100)
|
||||||
|
|
||||||
# Adjust base priority based on score difference
|
# Adjust base priority based on score difference
|
||||||
if score_difference > 3:
|
if score_difference > 3:
|
||||||
@@ -114,7 +114,9 @@ def calculate_game_priority(game):
|
|||||||
base_priority += 100
|
base_priority += 100
|
||||||
|
|
||||||
# Calculate time priority
|
# Calculate time priority
|
||||||
time_priority = (1200 - time_remaining) / 20
|
time_multiplier = {4: 2, 3: 2, 2: 1.5}.get(period, 0.75)
|
||||||
|
|
||||||
|
time_priority = ((1200 - time_remaining) / 20) * time_multiplier
|
||||||
|
|
||||||
# Calculate the final priority
|
# Calculate the final priority
|
||||||
final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)
|
final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)
|
||||||
@@ -122,7 +124,7 @@ def calculate_game_priority(game):
|
|||||||
return final_priority
|
return final_priority
|
||||||
|
|
||||||
def get_team_standings(team_name):
|
def get_team_standings(team_name):
|
||||||
conn = sqlite3.connect("nhl_standings.db")
|
conn = sqlite3.connect("app/data/nhl_standings.db")
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
SELECT league_sequence, league_l10_sequence
|
SELECT league_sequence, league_l10_sequence
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ h1 {
|
|||||||
color: #fff; /* White text color for live state */
|
color: #fff; /* White text color for live state */
|
||||||
font-weight: bolder; /* Bold text for live state */
|
font-weight: bolder; /* Bold text for live state */
|
||||||
z-index: 1; /* Ensure the live state box is above other content */
|
z-index: 1; /* Ensure the live state box is above other content */
|
||||||
|
width: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.live-state-intermission {
|
.live-state-intermission {
|
||||||
@@ -147,6 +148,7 @@ h1 {
|
|||||||
color: #fff; /* White text color for live state */
|
color: #fff; /* White text color for live state */
|
||||||
font-weight: bolder; /* Bold text for live state */
|
font-weight: bolder; /* Bold text for live state */
|
||||||
z-index: 1; /* Ensure the live state box is above other content */
|
z-index: 1; /* Ensure the live state box is above other content */
|
||||||
|
width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.live-time {
|
.live-time {
|
||||||
@@ -159,18 +161,26 @@ h1 {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #ddd; /* Lighter text color for time box */
|
color: #ddd; /* Lighter text color for time box */
|
||||||
z-index: 1; /* Ensure the time box is above other content */
|
z-index: 1; /* Ensure the time box is above other content */
|
||||||
|
width: 30px;
|
||||||
|
display: flex; /* Use flexbox */
|
||||||
|
justify-content: space-evenly; /* Center content horizontally */
|
||||||
|
align-items: center; /* Center content vertically */
|
||||||
}
|
}
|
||||||
|
|
||||||
.live-time-intermission {
|
.live-time-intermission {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
left: 60px; /* Adjusted left position */
|
left: 65px; /* Adjusted left position */
|
||||||
background-color: #444; /* Darker background color for time box */
|
background-color: #444; /* Darker background color for time box */
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #ddd; /* Lighter text color for time box */
|
color: #ddd; /* Lighter text color for time box */
|
||||||
z-index: 1; /* Ensure the time box is above other content */
|
z-index: 1; /* Ensure the time box is above other content */
|
||||||
|
width: 30px;
|
||||||
|
display: flex; /* Use flexbox */
|
||||||
|
justify-content: space-evenly; /* Center content horizontally */
|
||||||
|
align-items: center; /* Center content vertically */
|
||||||
}
|
}
|
||||||
|
|
||||||
#live-games-section {
|
#live-games-section {
|
||||||
|
|||||||
Reference in New Issue
Block a user