fix: force display updates for live NHL games when new data is received

This commit is contained in:
ChuckBuilds
2025-04-19 21:24:13 -05:00
parent b25342e4a9
commit 8216c7cd3b

View File

@@ -508,6 +508,7 @@ class NHLLiveManager(BaseNHLManager):
self.current_game_index = 0 # Index to track which game to show self.current_game_index = 0 # Index to track which game to show
self.last_game_switch = 0 # Track when we last switched games self.last_game_switch = 0 # Track when we last switched games
self.game_display_duration = self.nhl_config.get("live_game_duration", 20) # Display each live game for 20 seconds self.game_display_duration = self.nhl_config.get("live_game_duration", 20) # Display each live game for 20 seconds
self.last_display_update = 0 # Track when we last updated the display
# Initialize with test game only if test mode is enabled # Initialize with test game only if test mode is enabled
if self.test_mode: if self.test_mode:
@@ -594,6 +595,11 @@ class NHLLiveManager(BaseNHLManager):
self.last_game_switch = current_time self.last_game_switch = current_time
logging.info(f"[NHL] Switching to live game: {self.current_game['away_abbr']} vs {self.current_game['home_abbr']}") logging.info(f"[NHL] Switching to live game: {self.current_game['away_abbr']} vs {self.current_game['home_abbr']}")
# Always update the display when we have new data
if self.current_game and current_time - self.last_display_update >= 1: # Update display at most once per second
self.display(force_clear=True)
self.last_display_update = current_time
def display(self, force_clear: bool = False): def display(self, force_clear: bool = False):
"""Display live game information.""" """Display live game information."""
if not self.current_game: if not self.current_game: