From 62e99be45ba4033c2822f6383105f05d88e68821 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:33:51 -0500 Subject: [PATCH] fix: Update _has_news_changed to properly handle list format news data --- src/cache_manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cache_manager.py b/src/cache_manager.py index 0575da74..06347250 100644 --- a/src/cache_manager.py +++ b/src/cache_manager.py @@ -137,8 +137,11 @@ class CacheManager: def _has_news_changed(self, cached: Dict[str, Any], new: Dict[str, Any]) -> bool: """Check if news data has changed.""" # Handle both dictionary and list formats - if isinstance(cached, list) and isinstance(new, list): - # If both are lists, compare their lengths and content + if isinstance(new, list): + # 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): return True # Compare titles since they're unique enough for our purposes