mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
reduce logging for leaderboard dynamic duration
This commit is contained in:
@@ -519,6 +519,20 @@ class DisplayController:
|
|||||||
# Fall back to configured duration
|
# Fall back to configured duration
|
||||||
return self.display_durations.get(mode_key, 60)
|
return self.display_durations.get(mode_key, 60)
|
||||||
|
|
||||||
|
# Handle dynamic duration for leaderboard
|
||||||
|
if mode_key == 'leaderboard' and self.leaderboard:
|
||||||
|
try:
|
||||||
|
dynamic_duration = self.leaderboard.get_dynamic_duration()
|
||||||
|
# Only log if duration has changed or we haven't logged this duration yet
|
||||||
|
if not hasattr(self, '_last_logged_leaderboard_duration') or self._last_logged_leaderboard_duration != dynamic_duration:
|
||||||
|
logger.info(f"Using dynamic duration for leaderboard: {dynamic_duration} seconds")
|
||||||
|
self._last_logged_leaderboard_duration = dynamic_duration
|
||||||
|
return dynamic_duration
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error getting dynamic duration for leaderboard: {e}")
|
||||||
|
# Fall back to configured duration
|
||||||
|
return self.display_durations.get(mode_key, 60)
|
||||||
|
|
||||||
# Simplify weather key handling
|
# Simplify weather key handling
|
||||||
if mode_key.startswith('weather_'):
|
if mode_key.startswith('weather_'):
|
||||||
return self.display_durations.get(mode_key, 15)
|
return self.display_durations.get(mode_key, 15)
|
||||||
|
|||||||
@@ -1055,7 +1055,7 @@ class LeaderboardManager:
|
|||||||
logger.debug(f"Leaderboard enabled: {self.is_enabled}")
|
logger.debug(f"Leaderboard enabled: {self.is_enabled}")
|
||||||
logger.debug(f"Current scroll position: {self.scroll_position}")
|
logger.debug(f"Current scroll position: {self.scroll_position}")
|
||||||
logger.debug(f"Leaderboard image width: {self.leaderboard_image.width if self.leaderboard_image else 'None'}")
|
logger.debug(f"Leaderboard image width: {self.leaderboard_image.width if self.leaderboard_image else 'None'}")
|
||||||
logger.info(f"Using dynamic duration for leaderboard: {self.dynamic_duration}s")
|
logger.debug(f"Using dynamic duration for leaderboard: {self.dynamic_duration}s")
|
||||||
|
|
||||||
if not self.is_enabled:
|
if not self.is_enabled:
|
||||||
logger.debug("Leaderboard is disabled, exiting display method.")
|
logger.debug("Leaderboard is disabled, exiting display method.")
|
||||||
|
|||||||
Reference in New Issue
Block a user