diff --git a/config/config.template.json b/config/config.template.json index f2cb4e0d..388d8a77 100644 --- a/config/config.template.json +++ b/config/config.template.json @@ -305,6 +305,7 @@ ], "logo_dir": "assets/sports/ncaa_logos", "show_records": true, + "show_ranking": true, "display_modes": { "ncaa_fb_live": true, "ncaa_fb_recent": true, diff --git a/src/ncaa_fb_managers.py b/src/ncaa_fb_managers.py index 9baac1e8..0e82c24c 100644 --- a/src/ncaa_fb_managers.py +++ b/src/ncaa_fb_managers.py @@ -870,9 +870,6 @@ class NCAAFBLiveManager(BaseNCAAFBManager): # Renamed class self.logger.warning("[NCAAFB] Test mode: Could not parse clock") # Changed log prefix # No actual display call here, let main loop handle it else: - # Fetch rankings - self._fetch_rankings() - # Fetch live game data data = self._fetch_data() new_live_games = [] @@ -1000,23 +997,7 @@ class NCAAFBLiveManager(BaseNCAAFBManager): # Renamed class main_img.paste(away_logo, (away_x, away_y), away_logo) # --- Draw Text Elements on Overlay --- - # Ranking (if ranked) - home_rank = self._get_rank(game["home_abbr"]) - away_rank = self._get_rank(game["away_abbr"]) - - if home_rank > 0: - rank_text = str(home_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = home_x - 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) - - if away_rank > 0: - rank_text = str(away_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = away_x + away_logo.width + 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) + # Note: Rankings are now handled in the records/rankings section below # Scores (centered, slightly above bottom) home_score = str(game.get("home_score", "0")) @@ -1161,9 +1142,6 @@ class NCAAFBRecentManager(BaseNCAAFBManager): # Renamed class self.last_update = current_time # Update time even if fetch fails try: - # Fetch rankings - self._fetch_rankings() - data = self._fetch_data() # Uses shared cache if not data or 'events' not in data: self.logger.warning("[NCAAFB Recent] No events found in shared data.") # Changed log prefix @@ -1297,23 +1275,7 @@ class NCAAFBRecentManager(BaseNCAAFBManager): # Renamed class main_img.paste(away_logo, (away_x, away_y), away_logo) # Draw Text Elements on Overlay - # Ranking (if ranked) - home_rank = self._get_rank(game["home_abbr"]) - away_rank = self._get_rank(game["away_abbr"]) - - if home_rank > 0: - rank_text = str(home_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = home_x - 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) - - if away_rank > 0: - rank_text = str(away_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = away_x + away_logo.width - 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) + # Note: Rankings are now handled in the records/rankings section below # Final Scores (Centered, same position as live) home_score = str(game.get("home_score", "0")) @@ -1479,9 +1441,6 @@ class NCAAFBUpcomingManager(BaseNCAAFBManager): # Renamed class self.last_update = current_time try: - # Fetch rankings - self._fetch_rankings() - data = self._fetch_data() # Uses shared cache if not data or 'events' not in data: self.logger.warning("[NCAAFB Upcoming] No events found in shared data.") # Changed log prefix @@ -1669,24 +1628,7 @@ class NCAAFBUpcomingManager(BaseNCAAFBManager): # Renamed class game_date = game.get("game_date", "") game_time = game.get("game_time", "") - # Ranking (if ranked) - home_rank = self._get_rank(game["home_abbr"]) - away_rank = self._get_rank(game["away_abbr"]) - - if home_rank > 0: - rank_text = str(home_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = home_x - 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) - - if away_rank > 0: - rank_text = str(away_rank) - rank_width = draw_overlay.textlength(rank_text, font=self.fonts['rank']) - rank_x = away_x + away_logo.width - 8 - rank_y = 2 - self._draw_text_with_outline(draw_overlay, rank_text, (rank_x, rank_y), self.fonts['rank']) - + # Note: Rankings are now handled in the records/rankings section below # "Next Game" at the top (use smaller status font) status_text = "Next Game" diff --git a/templates/index.html b/templates/index.html index 59e3445b..6520006b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1277,6 +1277,26 @@
Only display games involving your favorite teams
+
+ +
+ +
+
Display team win-loss records in bottom corners
+
+
+ +
+ +
+
Display AP Top 25 rankings instead of records for ranked teams
+
@@ -2894,7 +2914,9 @@ live_priority: document.getElementById('ncaa_fb_live_priority').checked, live_game_duration: parseInt(document.getElementById('ncaa_fb_live_game_duration').value), show_odds: document.getElementById('ncaa_fb_show_odds').checked, - show_favorite_teams_only: document.getElementById('ncaa_fb_show_favorite_teams_only').checked + show_favorite_teams_only: document.getElementById('ncaa_fb_show_favorite_teams_only').checked, + show_records: document.getElementById('ncaa_fb_show_records').checked, + show_ranking: document.getElementById('ncaa_fb_show_ranking').checked }, ncaa_baseball_scoreboard: { enabled: document.getElementById('ncaa_baseball_enabled').checked,