mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
fix: Update _has_news_changed to properly handle list format news data
This commit is contained in:
@@ -137,8 +137,11 @@ class CacheManager:
|
|||||||
def _has_news_changed(self, cached: Dict[str, Any], new: Dict[str, Any]) -> bool:
|
def _has_news_changed(self, cached: Dict[str, Any], new: Dict[str, Any]) -> bool:
|
||||||
"""Check if news data has changed."""
|
"""Check if news data has changed."""
|
||||||
# Handle both dictionary and list formats
|
# Handle both dictionary and list formats
|
||||||
if isinstance(cached, list) and isinstance(new, list):
|
if isinstance(new, list):
|
||||||
# If both are lists, compare their lengths and content
|
# If new data is a list, cached data should also be a list
|
||||||
|
if not isinstance(cached, list):
|
||||||
|
return True
|
||||||
|
# Compare lengths and content
|
||||||
if len(cached) != len(new):
|
if len(cached) != len(new):
|
||||||
return True
|
return True
|
||||||
# Compare titles since they're unique enough for our purposes
|
# Compare titles since they're unique enough for our purposes
|
||||||
|
|||||||
Reference in New Issue
Block a user