mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
MLB logging changes to make sure we are filtering correctly
This commit is contained in:
@@ -1219,6 +1219,9 @@ class MLBUpcomingManager(BaseMLBManager):
|
||||
def update(self):
|
||||
"""Update upcoming games data."""
|
||||
current_time = time.time()
|
||||
# Log config state for debugging
|
||||
self.logger.info(f"[MLB] show_favorite_teams_only: {self.mlb_config.get('show_favorite_teams_only', False)}")
|
||||
self.logger.info(f"[MLB] favorite_teams: {self.favorite_teams}")
|
||||
if self.last_update != 0 and (current_time - self.last_update < self.update_interval):
|
||||
return
|
||||
|
||||
@@ -1239,15 +1242,20 @@ class MLBUpcomingManager(BaseMLBManager):
|
||||
# Only fetch odds for games that will be displayed
|
||||
if self.mlb_config.get("show_favorite_teams_only", False):
|
||||
if not self.favorite_teams:
|
||||
self.logger.info(f"[MLB] Skipping game {game_id} - no favorite teams configured.")
|
||||
continue
|
||||
if game['home_team'] not in self.favorite_teams and game['away_team'] not in self.favorite_teams:
|
||||
self.logger.info(f"[MLB] Skipping non-favorite team game: {game['away_team']} @ {game['home_team']}")
|
||||
continue
|
||||
is_favorite_game = (game['home_team'] in self.favorite_teams or
|
||||
game['away_team'] in self.favorite_teams)
|
||||
game_time = datetime.fromisoformat(game['start_time'].replace('Z', '+00:00'))
|
||||
if game_time.tzinfo is None:
|
||||
game_time = game_time.replace(tzinfo=timezone.utc)
|
||||
self.logger.info(f"[MLB] Favorite team game found: {game['away_team']} @ {game['home_team']} at {game_time}")
|
||||
if is_favorite_game:
|
||||
self.logger.info(f"[MLB] Favorite team game found: {game['away_team']} @ {game['home_team']} at {game_time}")
|
||||
else:
|
||||
self.logger.debug(f"[MLB] Non-favorite team game: {game['away_team']} @ {game['home_team']} at {game_time}")
|
||||
self.logger.info(f"[MLB] Game status: {game['status']}, State: {game['status_state']}")
|
||||
is_upcoming = (
|
||||
game['status_state'] not in ['post', 'final', 'completed'] and
|
||||
|
||||
@@ -1298,11 +1298,12 @@ class NCAAFBUpcomingManager(BaseNCAAFBManager): # Renamed class
|
||||
|
||||
center_y = self.display_height // 2
|
||||
|
||||
home_x = self.display_width - home_logo.width + 18
|
||||
# MLB-style logo positions
|
||||
home_x = self.display_width - home_logo.width + 2
|
||||
home_y = center_y - (home_logo.height // 2)
|
||||
main_img.paste(home_logo, (home_x, home_y), home_logo)
|
||||
|
||||
away_x = -18
|
||||
away_x = -2
|
||||
away_y = center_y - (away_logo.height // 2)
|
||||
main_img.paste(away_logo, (away_x, away_y), away_logo)
|
||||
|
||||
|
||||
@@ -1188,11 +1188,12 @@ class NFLUpcomingManager(BaseNFLManager): # Renamed class
|
||||
|
||||
center_y = self.display_height // 2
|
||||
|
||||
home_x = self.display_width - home_logo.width + 18
|
||||
# MLB-style logo positions
|
||||
home_x = self.display_width - home_logo.width + 2
|
||||
home_y = center_y - (home_logo.height // 2)
|
||||
main_img.paste(home_logo, (home_x, home_y), home_logo)
|
||||
|
||||
away_x = -18
|
||||
away_x = -2
|
||||
away_y = center_y - (away_logo.height // 2)
|
||||
main_img.paste(away_logo, (away_x, away_y), away_logo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user