remove dynamic duration calculation from startup loop

This commit is contained in:
Chuck
2025-07-27 10:08:03 -05:00
parent be50fb86d7
commit aef8b3b6cc
2 changed files with 7 additions and 7 deletions

View File

@@ -476,7 +476,8 @@ class DisplayController:
if self.youtube: self.youtube.update()
if self.text_display: self.text_display.update()
if self.of_the_day: self.of_the_day.update(time.time())
if self.news_manager: self.news_manager.fetch_news_data()
# News manager fetches data when displayed, not during updates
# if self.news_manager: self.news_manager.fetch_news_data()
# Update NHL managers
if self.nhl_live: self.nhl_live.update()

View File

@@ -430,6 +430,10 @@ class NewsManager:
self.display_manager.image = img
self.display_manager.update_display()
# Debug: log scroll position
if hasattr(self, 'scroll_position') and hasattr(self, 'total_scroll_width'):
logger.debug(f"Scroll position: {self.scroll_position}/{self.total_scroll_width}")
except Exception as e:
logger.error(f"Error in news display: {e}")
# Create error image
@@ -504,10 +508,5 @@ class NewsManager:
def get_dynamic_duration(self) -> int:
"""Get the calculated dynamic duration for display"""
# Ensure we have current data and calculated duration
if not self.cached_text or self.dynamic_duration == 60:
# Try to refresh if we don't have current data
if self.should_update() or not self.current_headlines:
self.fetch_news_data()
# Return the current calculated duration without fetching data
return self.dynamic_duration