mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
filtering logic for future and past games
This commit is contained in:
@@ -527,10 +527,8 @@ class BaseNFLManager: # Renamed class
|
||||
if away_record == "0-0":
|
||||
away_record = ''
|
||||
|
||||
# Filter by favorite teams if the list is not empty
|
||||
if self.favorite_teams and not (home_abbr in self.favorite_teams or away_abbr in self.favorite_teams):
|
||||
self.logger.debug(f"[NFL] Skipping non-favorite game: {away_abbr}@{home_abbr} in _extract_game_details")
|
||||
return None
|
||||
# Remove early filtering - let individual managers handle their own filtering
|
||||
# This allows shared data to contain all games, and each manager can filter as needed
|
||||
|
||||
game_time, game_date = "", ""
|
||||
if start_time_utc:
|
||||
@@ -1218,11 +1216,19 @@ class NFLUpcomingManager(BaseNFLManager): # Renamed class
|
||||
self._fetch_odds(game)
|
||||
processed_games.append(game)
|
||||
|
||||
# Debug logging to see what games we have
|
||||
self.logger.debug(f"[NFL Upcoming] Processed {len(processed_games)} upcoming games")
|
||||
for game in processed_games:
|
||||
self.logger.debug(f"[NFL Upcoming] Game: {game['away_abbr']}@{game['home_abbr']} - Upcoming: {game['is_upcoming']}")
|
||||
|
||||
# Filter for favorite teams
|
||||
if self.favorite_teams:
|
||||
team_games = [game for game in processed_games
|
||||
if game['home_abbr'] in self.favorite_teams or
|
||||
game['away_abbr'] in self.favorite_teams]
|
||||
self.logger.debug(f"[NFL Upcoming] After favorite team filtering: {len(team_games)} games")
|
||||
for game in team_games:
|
||||
self.logger.debug(f"[NFL Upcoming] Favorite game: {game['away_abbr']}@{game['home_abbr']}")
|
||||
else:
|
||||
team_games = processed_games # Show all upcoming if no favorites
|
||||
|
||||
|
||||
Reference in New Issue
Block a user