From c7634cbf3aa758f395675d8c7b1eb8b78230aac0 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Mon, 15 Sep 2025 16:00:14 -0400 Subject: [PATCH] NCAA FB odds fix --- src/ncaa_fb_managers.py | 4 ++++ src/odds_manager.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ncaa_fb_managers.py b/src/ncaa_fb_managers.py index ab4a6a47..659f6c00 100644 --- a/src/ncaa_fb_managers.py +++ b/src/ncaa_fb_managers.py @@ -1078,6 +1078,10 @@ class NCAAFBRecentManager(BaseNCAAFBManager): # Renamed class if game['home_abbr'] in self.favorite_teams or game['away_abbr'] in self.favorite_teams] self.logger.info(f"[NCAAFB Recent] Found {favorite_games_found} favorite team games out of {len(processed_games)} total final games within last 21 days") + + # Debug: Show which games are selected for display + for i, game in enumerate(team_games): + self.logger.info(f"[NCAAFB Recent DEBUG] Game {i+1} for display: {game['away_abbr']} @ {game['home_abbr']} - {game.get('start_time_utc')} - Score: {game['away_score']}-{game['home_score']}") else: team_games = processed_games # Show all recent games if no favorites defined self.logger.info(f"[NCAAFB Recent] Found {len(processed_games)} total final games within last 21 days (no favorite teams configured)") diff --git a/src/odds_manager.py b/src/odds_manager.py index 7b11b6b5..6f80e8c6 100644 --- a/src/odds_manager.py +++ b/src/odds_manager.py @@ -35,7 +35,17 @@ class OddsManager: self.logger.info(f"Cache miss - fetching fresh odds from ESPN for {cache_key}") try: - url = f"{self.base_url}/{sport}/leagues/{league}/events/{event_id}/competitions/{event_id}/odds" + # Map league names to ESPN API format + league_mapping = { + 'ncaa_fb': 'college-football', + 'nfl': 'nfl', + 'nba': 'nba', + 'mlb': 'mlb', + 'nhl': 'nhl' + } + + espn_league = league_mapping.get(league, league) + url = f"{self.base_url}/{sport}/leagues/{espn_league}/events/{event_id}/competitions/{event_id}/odds" self.logger.info(f"Requesting odds from URL: {url}") response = requests.get(url, timeout=10) response.raise_for_status()