mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
reduce logging frequency to make more sense of changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Pillow>=10.3.0
|
||||
pytz==2023.3
|
||||
requests==2.31.0
|
||||
requests>=2.32.0
|
||||
timezonefinder==6.2.0
|
||||
geopy==2.4.1
|
||||
rgbmatrix
|
||||
|
||||
@@ -150,7 +150,12 @@ class MusicManager:
|
||||
|
||||
def _handle_ytm_direct_update(self, ytm_data):
|
||||
"""Handles a direct state update from YTMClient."""
|
||||
logger.debug(f"MusicManager received direct YTM update: {ytm_data.get('track', {}).get('title') if ytm_data else 'No Data'}")
|
||||
# Correctly log the title from the ytm_data structure
|
||||
title_from_data = None
|
||||
if ytm_data and isinstance(ytm_data, dict):
|
||||
video_info = ytm_data.get('video', {})
|
||||
title_from_data = video_info.get('title')
|
||||
logger.debug(f"MusicManager received direct YTM update. Title from data: {title_from_data if title_from_data else 'No Title in video block'}")
|
||||
|
||||
if not self.enabled or not self.is_music_display_active: # Check if display is active
|
||||
logger.debug("Skipping YTM direct update: Manager disabled or music display not active.")
|
||||
|
||||
@@ -36,6 +36,7 @@ class YTMClient:
|
||||
self._connection_event = threading.Event()
|
||||
self.external_update_callback = update_callback
|
||||
self.last_processed_key_data = None # Stores key fields of the last update that triggered a callback
|
||||
self.previous_key_data_for_debug_logging = None # Helps reduce repetitive non-significant change logs
|
||||
|
||||
@self.sio.event(namespace='/api/v1/realtime')
|
||||
def connect():
|
||||
@@ -91,8 +92,12 @@ class YTMClient:
|
||||
self.external_update_callback(data)
|
||||
except Exception as cb_ex:
|
||||
logging.error(f"Error executing YTMClient external_update_callback: {cb_ex}")
|
||||
elif not significant_change_detected:
|
||||
logging.debug(f"YTM state update received but no significant change to key fields. Title: {current_key_data.get('title') if current_key_data else 'N/A'}")
|
||||
elif not significant_change_detected and current_key_data:
|
||||
if current_key_data != self.previous_key_data_for_debug_logging:
|
||||
logging.debug(f"YTM state update received but no significant change to callback. Title: {current_key_data.get('title')}, State: {current_key_data.get('trackState')}")
|
||||
self.previous_key_data_for_debug_logging = current_key_data
|
||||
elif not current_key_data:
|
||||
logging.debug("YTM state update received but current_key_data was None/empty.")
|
||||
|
||||
def load_config(self):
|
||||
default_url = "http://localhost:9863"
|
||||
|
||||
Reference in New Issue
Block a user