Commit Graph

167 Commits

Author SHA1 Message Date
Alex Resnick
3406234e00 Add NCAA Women's Hockey (#96)
* Add NCAA Womens Hockey

* Fix status text

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-10-05 15:19:03 -04:00
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
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
Alex Resnick
76a9e98ba7 Created Base Sports Classes (#39)
* rebase

* Update NFL and NCAA FB fetch

* update FB updates

* kinda working, kinda broken

* Fixed and update loggers

* move to individual files

* timeout updates

* seems to work well

* Leaderboard overestimates time

* ignore that

* minor syntax updates

* More consolidation but i broke something

* fixed

* Hockey seems to work

* Fix my changes to logo downloader

* even more consolidation

* fixes

* more cleanup

* inheritance stuff

* Change football to ESPN down text, it does what ur already doing. Change color to red on Red ZOne

* Fix leaderboard

* Update football.py

Signed-off-by: Alex Resnick <adr8292@gmail.com>

* Minor fixes

* don't want that

* background fetch

* whoops

---------

Signed-off-by: Alex Resnick <adr8292@gmail.com>
Co-authored-by: Alex Resnick <adr8282@gmail.com>
Co-authored-by: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-24 17:10:41 -04:00
Chuck
8cbdef3949 Fix/leaderboard timing improvements (#60)
* Fix leaderboard timing issues with comprehensive improvements

- Add maximum display time cap (120s) to prevent hanging
- Implement dynamic scroll speed tracking with runtime measurements
- Simplify complex timing logic that was causing hangs
- Add enhanced progress tracking and logging
- Add configurable safety buffer (10s)
- Update config template with new timing options
- Add comprehensive test suite for timing logic

Fixes the 30-second hanging issue reported in PR #53 by providing
multiple layers of protection against time overestimation.

* Simplify leaderboard timing to use long timeout with exception-based ending

- Remove complex dynamic duration calculations
- Remove safety buffer complexity
- Remove scroll speed tracking and measurements
- Use simple 10-minute timeout (600s) for both display_duration and max_display_time
- Let content determine when display is complete via existing StopIteration logic
- Update display controller to use simplified duration approach
- Clean up config template to remove unused timing settings

This approach is much more reliable than trying to predict content duration
and eliminates the hanging issues reported in PR #53.

* Fix configuration structure to use centralized display_durations

- Remove redundant display_duration from leaderboard section
- Use main display_durations.leaderboard (300s) for fixed duration mode
- Update leaderboard manager to read from centralized config
- Increase leaderboard default duration from 60s to 300s for better content coverage
- Maintain dynamic_duration option for user choice between fixed/dynamic modes
- Add comprehensive scroll behavior analysis and testing

This completes the leaderboard timing improvements with proper config structure.

* scroll every frame to be smoother like the stock ticker instead of waiting  per subsecond

* leaderboard block api calls while scrolling

* leaderboard debugging

* added leaderboard fps logging

* leaderboard frame control and optimizations

* background update memory leak for scrolling text found and first solution applied

* tuning scroll speeds

* working display scrolls

* revert scroll delay to 0.01 (about 100fps)

* revert min duration of leaderboard

* remove onetime test scripts
2025-09-22 20:42:10 -04:00
Alex Resnick
569576d4e8 Leaderboard hangs at end due to overestimate of time (#53)
* Leaderboard overestimates time


---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-22 10:31:13 -04:00
Chuck
b0b5af8e21 Fix sports managers background updates and update intervals (#51)
- Add all sports managers to background updates in display_controller.py
- Add all sports managers to deferred updates when scrolling
- Fix hardcoded update intervals in NHL, NBA, NCAA Basketball, and NCAA Hockey managers
- Use config values for recent_update_interval and upcoming_update_interval
- Ensure all sports managers update continuously in background
- Only NFL managers had the season fetching issue, others were already optimized
2025-09-22 10:21:37 -04:00
Chuck
cf15409973 Fix schedule timezone handling (#52)
- Add proper timezone support to _check_schedule() method
- Use configured timezone instead of system local time
- Add pytz import for timezone handling
- Ensures schedule respects America/Chicago timezone setting
- Fixes issue where display wouldn't turn off at configured end_time
2025-09-21 21:15:57 -04:00
Chuck
86049ca679 Fix nfl live update interval (#50)
* Fix NFL live update interval not being respected

- Add NFL managers to _update_modules() method in display_controller.py
- NFL managers now update continuously in background instead of only when displayed
- Fixes issue where NFL live data would only fetch once and never update
- NFL live manager now properly respects 30-second live_update_interval setting
- Also add NFL managers to deferred updates when display is scrolling

* Fix NFL Recent and Upcoming managers to use correct update intervals

- NFL Recent Manager now uses recent_update_interval (3600 seconds) instead of hardcoded 300
- NFL Upcoming Manager now uses upcoming_update_interval (3600 seconds) instead of hardcoded 300
- Ensures proper update intervals: Live=30s, Recent=3600s, Upcoming=3600s
- All managers respect their respective config intervals

* Fix NCAAFB managers to use correct update intervals and add to background updates

- NCAAFB Recent Manager now uses recent_update_interval (3600 seconds) instead of hardcoded 300
- NCAAFB Upcoming Manager now uses upcoming_update_interval (3600 seconds) instead of hardcoded 300
- Add NCAAFB managers to _update_modules() method in display_controller.py
- NCAAFB managers now update continuously in background instead of only when displayed
- Add NCAAFB managers to deferred updates when display is scrolling
- Ensures proper update intervals: Live=30s, Recent=3600s, Upcoming=3600s

* Fix NFL live manager to use cached data for fresh updates

- Change NFL Live Manager to use cache=True instead of cache=False
- NFL Live Manager was bypassing cache and not getting fresh data from background service
- Background service fetches and caches data, but live manager was ignoring the cache
- This fixes the issue where NFL live display shows stale data despite successful background fetches
- Live manager now gets fresh data from the background service cache

* Fix NFL live manager to force fresh data fetch when update interval passes

- NFL Live Manager now forces fresh fetch when update interval (30s) has passed
- Uses cache for immediate response but bypasses cache for fresh updates
- Adds logging to show when fresh fetch is forced
- This ensures live game data updates every 30 seconds with fresh scores/clock
- Fixes issue where live display was showing stale data despite background fetches

* Fix NFL live manager to always fetch fresh data from API

- NFL Live Manager now always fetches fresh data directly from ESPN API
- No cache usage for live games - ensures real-time scores and clock updates
- Live games should always show the latest information, not cached data
- This ensures live display updates every 30 seconds with current game state

* Fix NFL live manager to use synchronous API fetch for real-time updates

- NFL Live Manager now uses _fetch_nfl_api_data_sync() for direct API calls
- Bypasses background service and cache for immediate fresh data
- Ensures live games get real-time scores and clock updates every 30 seconds
- Direct API calls are faster and more reliable for live game data

* Fix NFL live manager to fetch only current games instead of entire season

- Create _fetch_current_nfl_games() method for live updates
- Only fetches current week's games, not entire 2025 season (335 events)
- Much faster API calls - only gets relevant live games
- Reduces API load and improves performance for live updates
- NFL Live Manager now fetches ~10-15 current games instead of 335 season games

* ensure live games aren't pulling whole season

* bugbot catches
2025-09-18 23:29:11 -04:00
Chuck
e894c40ff4 Merge development into main
- Resolved conflicts in src/logo_downloader.py:
  - Combined NCAA hockey endpoint with soccer league endpoints
  - Updated directory mappings to use ncaa_logos for NCAA sports
  - Added support for multiple soccer leagues (Premier League, La Liga, etc.)

- Resolved conflicts in src/ncaa_fb_managers.py:
  - Combined immediate fetch approach with background fetch strategy
  - Maintained both immediate response and comprehensive data fetching
  - Preserved caching functionality for improved performance

- Includes all development branch features:
  - Soccer league support with team logos
  - Enhanced NCAA football data fetching
  - Improved logo downloader with multiple league support
  - Updated wiki documentation and configuration
2025-09-16 15:37:59 -04:00
Chuck
d78c592d6a NCAA FB season now downloads in full but it slows down the display significantly, data fetch has been moved to the background and deferred during scrolling displays 2025-09-15 18:12:54 -04:00
Alex Resnick
515ae2c7e9 Add NCAA Hockey (#36)
* Add emulator

* Update limit for ESPM API

* use params

* Add NCAA Mens Hockey  Manager

* Add NCAA Hockey to leader board

* update logos

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-14 18:08:32 -04:00
Chuck
96f6749516 change width draw logic in leaderboard display 2025-09-12 17:21:20 -04:00
Chuck
bc3883df14 config manager reductions to reduce overhead 2025-09-12 17:15:45 -04:00
Chuck
4cfaa5ca59 reduce logging for leaderboard dynamic duration 2025-09-12 15:13:13 -04:00
ChuckBuilds
8a0fdb005d update UTC timezone logic to check config settings for all managers 2025-09-04 22:18:01 -04:00
ChuckBuilds
e63198dc49 scroll priority to determine data refreshes 2025-08-18 15:21:39 -05:00
ChuckBuilds
e3b65588a2 support older versions of python not having the Union import 2025-08-15 09:38:23 -05:00
Chuck
03f0a6e6e2 troubleshoot milb upcoming 2025-08-11 17:25:03 -05:00
Chuck
865b30c631 reduce log spam 2025-08-11 15:45:19 -05:00
Chuck
edce5fae85 milb upcoming game debug logging 2025-08-10 18:26:25 -05:00
Chuck
85d63243c7 AI bug squash sesh 2025-08-09 21:00:25 -05:00
Chuck
bd9fe652d9 only call update module for active displays 2025-08-09 20:44:31 -05:00
Chuck
8703c485bc live priority rotation fix 2025-08-09 20:31:47 -05:00
Chuck
6fdb2b55b5 improved sport switching on simultaneous displays 2025-08-09 20:17:54 -05:00
Chuck
b0941641c7 added dynamic display durations to scrolling managers 2025-08-09 17:15:14 -05:00
Chuck
512ffb7639 live games respect update durations from config 2025-08-09 12:00:12 -05:00
Chuck
b4d5aef876 milb logging and manual cache clearing 2025-08-09 10:44:58 -05:00
Chuck
b193e03be9 milb_manager live display logic update and enable mls 2025-08-09 10:30:01 -05:00
Chuck
c490c5dca8 ensure displays share config file 2025-08-02 19:33:24 -05:00
Chuck
c92eaa93bd Merge cursor/modernize-and-enhance-led-matrix-web-interface-24d0 into development 2025-07-31 22:27:30 -05:00
Chuck
b451d5def8 Respect live game display duration when no priority is given 2025-07-31 21:52:21 -05:00
Chuck
41ed6b8a43 call managers differently 2025-07-30 16:37:05 -05:00
Chuck
06a51b5799 non-priority live game logic update 2025-07-30 16:11:48 -05:00
Chuck
5001e59ee3 non-priority live game error 2025-07-30 15:53:51 -05:00
Chuck
85747edff1 non-priority rotation fix 2025-07-30 15:15:06 -05:00
Chuck
a2988557de better log messaging about what display going to and from 2025-07-30 14:22:17 -05:00
Chuck
6d8e7abff7 reduce dynamic duration logging 2025-07-27 10:14:55 -05:00
Chuck
aef8b3b6cc remove dynamic duration calculation from startup loop 2025-07-27 10:08:03 -05:00
Chuck
b6751a94c2 Sports news ticker with dynamic headline scrolling (#9)
* Add news manager with RSS feed ticker and dynamic scrolling

Co-authored-by: charlesmynard <charlesmynard@gmail.com>

* Add F1 feeds, custom feed management script, and comprehensive feed guide

Co-authored-by: charlesmynard <charlesmynard@gmail.com>

* Remove emoji and improve error/success message formatting

Co-authored-by: charlesmynard <charlesmynard@gmail.com>

* Add dynamic duration feature for news display with configurable timing

Co-authored-by: charlesmynard <charlesmynard@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-07-27 09:53:19 -05:00
Chuck
8b0c71dbdf new display logic for non-priority games 2025-07-26 20:42:56 -05:00
Chuck
2f7fa481a3 non-priority sports logic improvement 2025-07-26 19:34:41 -05:00
Chuck
c0d299892e live game duration 2025-07-24 12:32:38 -05:00
Chuck
cb81bec042 add Of The Day display 2025-07-22 20:39:09 -05:00
Chuck
8dccebff01 centered team logos in odds ticker and removed dynamic display duration 2025-07-21 16:42:24 -05:00
Chuck
8b8b087f9a dynamically define time on screen to rotate through odds ticker display 2025-07-20 21:28:29 -05:00
Chuck
ab7d0278cc format gambling displays for all sports, add gambling ticker 2025-07-20 17:19:21 -05:00
Chuck
21773cd948 adjustments in Display scheduling to fix blank screen after re-activated 2025-07-09 07:35:27 -05:00
Chuck
1eedcbac68 remove sleep from display controller due to negative impact on scrolling text 2025-07-08 20:23:45 -05:00
Chuck
9bb4f088a6 adding scheduling function to web ui and display 2025-07-08 19:33:08 -05:00