Feature/ap top 25 dynamic teams (#68)

* feat: Add AP Top 25 dynamic teams feature

- Add DynamicTeamResolver for resolving AP_TOP_25, AP_TOP_10, AP_TOP_5 to actual team abbreviations
- Integrate dynamic team resolution into SportsCore base class
- Add comprehensive test suite for dynamic team functionality
- Update config template with AP_TOP_25 example
- Add complete documentation for the new feature

Features:
- Automatic weekly updates of AP Top 25 rankings
- 1-hour caching for performance optimization
- Support for AP_TOP_25, AP_TOP_10, AP_TOP_5 dynamic teams
- Seamless integration with existing favorite teams system
- Comprehensive error handling and edge case support

Tests:
- Unit tests for core dynamic team resolution
- Integration tests for configuration scenarios
- Performance tests for caching functionality
- Edge case tests for unknown dynamic teams

All tests passing with 100% success rate.

* docs: Update wiki submodule with AP Top 25 documentation

- Add comprehensive documentation for AP Top 25 dynamic teams feature
- Include usage examples, configuration guides, and troubleshooting
- Update submodule reference to include new documentation

* feat: Add AP_TOP_25 support to odds ticker

- Integrate DynamicTeamResolver into OddsTickerManager
- Resolve dynamic teams for all enabled leagues during initialization
- Add comprehensive logging for dynamic team resolution
- Support AP_TOP_25, AP_TOP_10, AP_TOP_5 in odds ticker
- Add test suite for odds ticker dynamic teams integration

Features:
- Odds ticker now automatically resolves AP_TOP_25 to current top 25 teams
- Shows odds for all current AP Top 25 teams automatically
- Updates weekly when rankings change
- Works seamlessly with existing favorite teams system
- Supports mixed regular and dynamic teams

Tests:
- Configuration integration tests
- Multiple league configuration tests
- Edge case handling tests
- All tests passing with 100% success rate
This commit is contained in:
Chuck
2025-09-25 18:26:30 -04:00
committed by GitHub
parent 5bfcdaf4ff
commit abceb8205c
11 changed files with 1153 additions and 253 deletions

View File

@@ -13,6 +13,7 @@ from src.cache_manager import CacheManager
from src.odds_manager import OddsManager
from src.logo_downloader import download_missing_logo
from src.background_data_service import get_background_service
from src.dynamic_team_resolver import DynamicTeamResolver
# Import the API counter function from web interface
try:
@@ -140,6 +141,9 @@ class OddsTickerManager:
# Font setup
self.fonts = self._load_fonts()
# Initialize dynamic team resolver
self.dynamic_resolver = DynamicTeamResolver()
# League configurations
self.league_configs = {
'nfl': {
@@ -216,6 +220,21 @@ class OddsTickerManager:
}
}
# Resolve dynamic teams for each league
for league_key, league_config in self.league_configs.items():
if league_config.get('enabled', False):
raw_favorite_teams = league_config.get('favorite_teams', [])
if raw_favorite_teams:
# Resolve dynamic teams for this league
resolved_teams = self.dynamic_resolver.resolve_teams(raw_favorite_teams, league_key)
league_config['favorite_teams'] = resolved_teams
# Log dynamic team resolution
if raw_favorite_teams != resolved_teams:
logger.info(f"Resolved dynamic teams for {league_key}: {raw_favorite_teams} -> {resolved_teams}")
else:
logger.info(f"Favorite teams for {league_key}: {resolved_teams}")
logger.info(f"OddsTickerManager initialized with enabled leagues: {self.enabled_leagues}")
logger.info(f"Show favorite teams only: {self.show_favorite_teams_only}")