Commit Graph

36 Commits

Author SHA1 Message Date
Chuck
f3d02e07ea Feature/static image manager (#95)
* feat(static-image): Add static image manager with web interface

- Create StaticImageManager class with image scaling and transparency support
- Add configuration options for display duration, zoom scale, and background color
- Integrate with display controller and web interface
- Add image upload functionality to web interface
- Support for various image formats with proper scaling
- Efficient image processing with aspect ratio preservation
- Ready for future scrolling feature implementation

* fix(static-image): Move display duration to main display_durations block

- Remove display_duration from static_image config section
- Update StaticImageManager to read duration from display.display_durations.static_image
- Remove display duration field from web interface form
- Update web interface JavaScript to not include display_duration in payload
- Follows same pattern as all other managers in the project

* feat(static-image): Add fit to display option

- Add fit_to_display checkbox to automatically scale images to fit display
- When enabled, images are scaled to fit display dimensions while preserving aspect ratio
- When disabled, manual zoom_scale control is available
- Update web interface with smart form controls (zoom scale disabled when fit to display is on)
- Prevents stretching or cropping - images are always properly fitted
- Default to fit_to_display=true for better user experience

* refactor(static-image): Remove zoom_scale and simplify to fit_to_display only

- Remove zoom_scale option entirely as it was confusing and redundant
- Simplify image processing to always fit to display dimensions
- Remove zoom_scale field from web interface
- Clean up JavaScript to remove zoom scale logic
- Images are now always properly fitted without stretching or cropping
- Much simpler and more intuitive user experience
2025-10-05 10:46:36 -04:00
Chuck
4adb7b49ba fix: Resolve permission errors in soccer_manager logo downloads (#90)
- Fix download_missing_logo call to use correct signature with Path parameter
- Add comprehensive permission error handling with helpful error messages
- Include instructions to run fix_assets_permissions.sh when permission errors occur
- Improve error logging for directory listing and logo access permission issues
- Add test script to verify permission error handling works correctly

Fixes: [Errno 13] Permission denied errors when downloading soccer team logos
2025-10-01 10:14:34 -04:00
Chuck
e584026bda cursor rules (#87) 2025-09-29 21:42:12 -04:00
Chuck
fc06493990 Fix/logo download permission error (#70)
* fix: Resolve permission errors when downloading sports logos

- Fix fix_assets_permissions.sh to use correct directory name 'ncaa_logos' instead of 'ncaa_fbs_logos'
- Add comprehensive permission checking in logo downloader
- Improve error handling with specific permission error messages
- Add write access testing before attempting logo downloads
- Provide clear instructions to run permission fix script when errors occur

Fixes: [Errno 13] Permission denied errors when downloading team logos like SELA.png

* fix: Update first_time_install.sh to use correct ncaa_logos directory

- Fix manual permission setting section to use 'ncaa_logos' instead of 'ncaa_fbs_logos'
- Ensures consistency across all installation scripts
- Prevents permission issues during first-time installation

* fix: Update all remaining references from ncaa_fbs_logos to ncaa_logos

- Fix README.md directory reference
- Update wiki documentation files (MANAGER_GUIDE_COMPREHENSIVE.md, TEAM_ABBREVIATIONS_AND_LEAGUE_SLUGS.md)
- Fix test files (save_missing_teams.py, test_ranking_toggle.py, test_leaderboard_simple.py)
- Update missing_team_logos.txt with correct directory paths

Ensures complete consistency across the entire project for NCAA logo directory naming.
2025-09-25 19:21:26 -04:00
Chuck
abceb8205c 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
2025-09-25 18:26:30 -04:00
Chuck
ad8a652183 Fix leaderboard scrolling performance after PR #39 merge (#63)
* Fix leaderboard scrolling performance after PR #39 merge

- Restore leaderboard background updates that were accidentally removed
- Fix duration method call from get_dynamic_duration() back to get_duration()
- Restore proper fallback duration (600s instead of 60s) for leaderboard
- Add back sports manager updates that feed data to leaderboard
- Fix leaderboard defer_update priority to prevent scrolling lag

These changes restore the leaderboard's dynamic duration calculation
and ensure it gets proper background updates for smooth scrolling.

* Apply PR #60 leaderboard performance optimizations

- Change scroll_delay from 0.05s to 0.01s (100fps instead of 20fps)
- Remove conditional scrolling logic - scroll every frame for smooth animation
- Add FPS tracking and logging for performance monitoring
- Restore high-framerate scrolling that was working before PR #39 merge

These changes restore the smooth leaderboard scrolling performance
that was achieved in PR #60 but was lost during the PR #39 merge.

* Fix critical bugs identified in PR #39 review

- Fix record filtering logic bug: change away_record == set to away_record in set
- Fix incorrect sport specification: change 'nfl' to 'ncaa_fb' for NCAA Football data requests
- These bugs were causing incorrect data display and wrong sport data fetching

Addresses issues found by cursor bot in PR #39 review:
- Record filtering was always evaluating to False
- NCAA Football was fetching NFL data instead of college football data

* Enhance cache clearing implementation from PR #39

- Add detailed logging to cache clearing process for better visibility
- Log cache clearing statistics (memory entries and file count)
- Improve startup logging to show cache clearing and data refetch process
- Addresses legoguy1000's comment about preventing stale data issues

This enhances the cache clearing implementation that was added in PR #39
to help prevent legacy cache issues and stale data problems.

* continuing on base_classes - added baseball and api extractor since we don't use ESPN api for all sports

* tests

* fix missing duration

* ensure milb, mlb, ncaa bb are all using new baseball base class properly

* cursor rule to help with PR creation

* fix image call

* fix _scoreboard suffix on milb, MLB
2025-09-25 09:34:20 -04:00
Chuck
9dc1118d79 Feature/background season data (#46)
* Fix NCAAFB ranking display issue

- Remove duplicate ranking system that was drawing rankings behind team logos
- Old system (_get_rank) was drawing rankings at top of logos
- New system (_fetch_team_rankings) correctly draws rankings in bottom corners
- Remove old ranking calls from live, recent, and upcoming game drawing functions
- Remove unnecessary _fetch_rankings() calls from update methods
- Rankings now only appear in designated corner positions, not overlapping logos

Fixes issue where team rankings/betting lines were being drawn behind
team logos instead of replacing team records in the corners.

* Add missing show_ranking and show_records options to NCAAFB web UI

- Add show_ranking option to NCAAFB scoreboard config template
- Add show_records and show_ranking toggle switches to NCAAFB web UI
- Update JavaScript form collection to include new fields
- Users can now control whether to show team records or rankings via web interface

This completes the fix for NCAAFB ranking display - users can now enable
show_ranking in the web UI to see AP Top 25 rankings instead of team records.

* Implement Background Threading for Season Data Fetching

Phase 1: Background Season Data Fetching - COMPLETED

Key Features:
- Created BackgroundDataService class with thread-safe operations
- Implemented automatic retry logic with exponential backoff
- Modified NFL manager to use background service
- Added immediate partial data return for non-blocking display
- Comprehensive logging and statistics tracking

Performance Benefits:
- Main display loop no longer blocked by API calls
- Season data always fresh with background updates
- Better user experience during data fetching

Files Added/Modified:
- src/background_data_service.py (NEW)
- src/nfl_managers.py (updated)
- config/config.template.json (updated)
- test_background_service.py (NEW)
- BACKGROUND_SERVICE_README.md (NEW)

* Fix data validation issues in background service

- Add comprehensive data structure validation in NFL managers
- Handle malformed events gracefully with proper error logging
- Validate cached data format and handle legacy formats
- Add data validation in background service response parsing
- Fix TypeError: string indices must be integers, not 'str'

This fixes the error where events were being treated as strings
instead of dictionaries, causing crashes in recent/upcoming games.

* Phase 2: Apply Background Service to Major Sport Managers

 Applied background service support to:
- NCAAFB Manager (College Football)
- NBA Manager (Basketball)
- NHL Manager (Hockey)
- MLB Manager (Baseball)

🔧 Key Features Added:
- Background service initialization for each sport
- Configurable workers, timeouts, and retry settings
- Graceful fallback when background service is disabled
- Comprehensive logging for monitoring

⚙️ Configuration Updates:
- Added background_service config section to NBA
- Added background_service config section to NHL
- Added background_service config section to NCAAFB
- Each sport can independently enable/disable background service

📈 Performance Benefits:
- Season data fetching no longer blocks display loops
- Immediate response with cached/partial data
- Background threads handle heavy API calls
- Better responsiveness across all supported sports

Next: Apply to remaining managers (MiLB, Soccer, etc.)

* Fix Python compatibility issue in BackgroundDataService shutdown

🐛 Bug Fix:
- Fixed TypeError in ThreadPoolExecutor.shutdown() for older Python versions
- Added try/catch to handle timeout parameter compatibility
- Fallback gracefully for Python < 3.9 that doesn't support timeout parameter

🔧 Technical Details:
- ThreadPoolExecutor.shutdown(timeout=) was added in Python 3.9
- Older versions only support shutdown(wait=)
- Added compatibility layer with proper error handling

 Result:
- No more shutdown exceptions on older Python versions
- Graceful degradation for different Python environments
- Maintains full functionality on newer Python versions

* Phase 2 Complete: Background Service Applied to All Sport Managers

🎉 MAJOR MILESTONE: Complete Background Service Rollout

 All Sport Managers Now Support Background Service:
- MiLB Manager (Minor League Baseball)
- Soccer Manager (Multiple leagues: Premier League, La Liga, etc.)
- Leaderboard Manager (Multi-sport standings)
- Odds Ticker Manager (Live betting odds)

🔧 Technical Implementation:
- Background service initialization in all managers
- Configurable workers, timeouts, and retry settings
- Graceful fallback when background service is disabled
- Comprehensive logging for monitoring and debugging
- Thread-safe operations with proper error handling

⚙️ Configuration Support Added:
- MiLB: background_service config section
- Soccer: background_service config section
- Leaderboard: background_service config section
- Odds Ticker: background_service config section
- Each manager can independently enable/disable background service

📈 Performance Benefits Achieved:
- Non-blocking data fetching across ALL sport managers
- Immediate response with cached/partial data
- Background threads handle heavy API calls
- Significantly improved responsiveness
- Better user experience during data loading

🚀 Production Ready:
- All major sport managers now support background threading
- Comprehensive configuration options
- Robust error handling and fallback mechanisms
- Ready for production deployment

Next: Phase 3 - Advanced features (priority queuing, analytics)

* Update wiki submodule with Background Service documentation

📚 Wiki Documentation Added:
- Complete Background Service Guide with architecture diagrams
- Configuration examples and best practices
- Performance benefits and troubleshooting guide
- Migration guide and advanced features

🔧 Navigation Updates:
- Added to sidebar under Technical section
- Updated home page with performance section
- Highlighted as NEW feature with  icon

The wiki now includes comprehensive documentation for the new
background threading system that improves performance across
all sport managers.

* Fix CacheManager constructor in test script

🐛 Bug Fix:
- Fixed CacheManager initialization in test_background_service.py
- CacheManager no longer takes config_manager parameter
- Updated constructor call to match current implementation

 Result:
- Test script now works with current CacheManager API
- Background service testing can proceed without errors

* Move test_background_service.py to test/ directory

📁 Organization Improvement:
- Moved test_background_service.py from root to test/ directory
- Updated import paths to work from new location
- Fixed sys.path to correctly reference src/ directory
- Updated imports to use relative paths

🔧 Technical Changes:
- Changed sys.path from 'src' to '../src' (go up from test/)
- Updated imports to remove 'src.' prefix
- Maintains all functionality while improving project structure

 Benefits:
- Better project organization
- Test files properly grouped in test/ directory
- Cleaner root directory structure
- Follows standard Python project layout

* Remove old test_background_service.py from root directory

📁 Cleanup:
- Removed test_background_service.py from root directory
- File has been moved to test/ directory for better organization
- Maintains clean project structure

* Fix NCAA FB team ranking display functionality

- Add missing _fetch_team_rankings() calls to all update methods (live, recent, upcoming)
- Add ranking display logic to live manager scorebug layout
- Remove unused old _fetch_rankings() method and top_25_rankings variable
- Rankings now properly display as #X format when show_ranking is enabled
- Fixes non-functional ranking feature despite existing UI and configuration options
2025-09-17 17:25:01 -04:00
Chuck
764d80e818 added more missing soccer logos 2025-09-16 14:31:31 -04:00
Chuck
fcbc67464d persistent config file via config.template.json and migrate_config.sh 2025-09-15 10:27:16 -04:00
Chuck
b8aaa56b4b Add NCAA football logo download script and update team abbreviations
- Added download_espn_ncaa_fb_logos.py script to download logos from ESPN API
- Downloaded 50 NCAA football team logos to test/ncaaFBlogos/
- Updated all_team_abbreviations.txt with current ESPN team data
- Updated various team logo files (MLB, NBA, NFL, NHL, NCAAF)
2025-09-12 18:01:43 -04:00
Chuck
335ab8cce0 update leaderboard data sources for other sports and font sizes 2025-09-12 13:35:01 -04:00
Chuck
153edcc2e1 update record & rank logic, update leaderboard font and logo sizes 2025-09-12 12:08:46 -04:00
Chuck
548bc00e00 use correct AP Poll top 25 for NCAAFB 2025-09-12 11:50:51 -04:00
Chuck
3329822a46 update tnt logo 2025-09-10 18:21:03 -04:00
Chuck
3ee7821353 update some broadcast logos and fix multiple stacked panels logic 2025-09-10 18:13:42 -04:00
Chuck
457f9f9eb5 better error handling and correct image call for top 25 2025-09-10 16:45:34 -04:00
ChuckBuilds
8a0fdb005d update UTC timezone logic to check config settings for all managers 2025-09-04 22:18:01 -04:00
ChuckBuilds
e4b3adb867 Fix test script to handle missing game data keys
- Added safe key access using .get() method with defaults
- Added display of available keys in game data for debugging
- Added sport field display to help identify data structure
- This prevents KeyError when game data structure changes
2025-08-18 19:09:50 -05:00
ChuckBuilds
9f00124fad Fix odds ticker dynamic duration calculation
- Fixed double-counting of display width in total_scroll_width calculation
- Added detailed debug logging for dynamic duration calculation
- Added debug logging for scrolling behavior and loop resets
- Created test script for debugging dynamic duration issues
- The issue was that total_scroll_width included display width, causing
  incorrect duration calculations that resulted in early cutoff
2025-08-18 19:05:36 -05:00
ChuckBuilds
68416d0293 live games in odds ticker 2025-08-18 15:50:23 -05:00
ChuckBuilds
54635fee3c ensure game rotation count respects user defined variable 2025-08-14 13:01:23 -05:00
Chuck
ede82406fa set web ui v2 to be default 2025-08-10 17:18:59 -05:00
Chuck
85d63243c7 AI bug squash sesh 2025-08-09 21:00:25 -05:00
Chuck
afb7e23fcc fix soccer timezone 2025-08-09 16:03:02 -05:00
Chuck
1ffe3e7c16 add favorite team filtering to soccer manager and ensure timezones are respected 2025-08-09 15:54:15 -05:00
Chuck
4088807c72 milb_manager cache test 2025-08-09 10:22:56 -05:00
Chuck
3c665c21d1 milb turn off test mode.... 2025-08-02 17:31:35 -05:00
Chuck
f95138d1a4 milb diagnosis script with error fixes 2025-08-01 17:56:53 -05:00
Chuck
04009f78f7 milb diagnosis 2025-08-01 17:52:06 -05:00
Chuck
9280538e08 adjust user configurable parts of stock ticker 2025-07-23 17:02:50 -05:00
Chuck
b5b18babe8 revert daily weather temp font change due to negative effects on other displays 2025-07-23 14:27:50 -05:00
Chuck
723b7ce190 fix bdf font for weather 2025-07-23 14:17:53 -05:00
Chuck
b6244075a7 change font test size 2025-07-22 21:46:33 -05:00
Chuck
7c45179248 update parent directory of font test 2025-07-22 21:40:45 -05:00
Chuck
cb81bec042 add Of The Day display 2025-07-22 20:39:09 -05:00
Chuck
3ab28e8201 move test files to test folder to clean up repo 2025-07-22 20:01:39 -05:00