check for league in preferred games

This commit is contained in:
2026-05-06 03:24:34 -04:00
parent bb3aa2e704
commit 8d7bc08499
+6 -4
View File
@@ -366,9 +366,10 @@ def run():
current_preferred_game = 0 current_preferred_game = 0
preferred_games = [] preferred_games = []
preferred_teams = [ preferred_teams = [
"BUF", ("BUF", "nfl"),
"TOR", ("BUF", "nhl"),
"COL" ("TOR", "mlb"),
("LAL", "nba")
] ]
while True: while True:
@@ -377,6 +378,7 @@ def run():
if now - last_fetch > 30 or len(games) <= 0: if now - last_fetch > 30 or len(games) <= 0:
games = get_all_scores() games = get_all_scores()
last_fetch = now last_fetch = now
print(games)
if games: if games:
canvas.Clear() canvas.Clear()
@@ -389,7 +391,7 @@ def run():
# get new preferred games # get new preferred games
for game in games: for game in games:
if game['away'] in preferred_teams or game['home'] in preferred_teams: if (game['away'], game['league']) in preferred_teams or (game['home'], game['league']) in preferred_teams:
if 'Final' not in game['status'] and game['id'] not in preferred_games: if 'Final' not in game['status'] and game['id'] not in preferred_games:
preferred_games.append(game['id']) preferred_games.append(game['id'])