From f608331867fe197117f90aadcc53c618a6851b8f Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 31 Mar 2026 22:25:25 -0700 Subject: [PATCH] Ensure all watchlist scanner album fetches bypass cache The previous commit only added skip_cache=True to one call site in web_server.py. The watchlist scanner in core/watchlist_scanner.py has 6 Spotify get_artist_albums calls that also need fresh data to detect new releases. All now bypass cache. iTunes/Deezer calls are unaffected (they don't have the skip_cache param, detected via hasattr check). --- core/watchlist_scanner.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/watchlist_scanner.py b/core/watchlist_scanner.py index 223b2ffa..a77b9a92 100644 --- a/core/watchlist_scanner.py +++ b/core/watchlist_scanner.py @@ -850,7 +850,7 @@ class WatchlistScanner: try: # Get all artist albums (albums + singles) - this is rate limited in spotify_client logger.debug(f"Fetching discography for artist {spotify_artist_id}") - albums = self.spotify_client.get_artist_albums(spotify_artist_id, album_type='album,single', limit=50) + albums = self.spotify_client.get_artist_albums(spotify_artist_id, album_type='album,single', limit=50, skip_cache=True) if not albums: logger.warning(f"No albums found for artist {spotify_artist_id}") @@ -906,8 +906,10 @@ class WatchlistScanner: """ try: # Get all artist albums (albums + singles) + # skip_cache for Spotify so watchlist scans always get fresh data logger.debug(f"Fetching discography for artist {artist_id}") - albums = client.get_artist_albums(artist_id, album_type='album,single', limit=50) + _skip = {'skip_cache': True} if hasattr(client, 'sp') else {} + albums = client.get_artist_albums(artist_id, album_type='album,single', limit=50, **_skip) if not albums: logger.warning(f"No albums found for artist {artist_id}") @@ -1914,7 +1916,8 @@ class WatchlistScanner: all_albums = self.spotify_client.get_artist_albums( artist_id, album_type='album,single,ep', - limit=50 + limit=50, + skip_cache=True ) else: # itunes or deezer fallback all_albums = itunes_client.get_artist_albums( @@ -2319,7 +2322,8 @@ class WatchlistScanner: recent_releases = self.spotify_client.get_artist_albums( artist.spotify_artist_id, album_type='album,single,ep', - limit=5 + limit=5, + skip_cache=True ) if not recent_releases: @@ -2556,7 +2560,8 @@ class WatchlistScanner: albums = self.spotify_client.get_artist_albums( artist.spotify_artist_id, album_type='album,single,ep', - limit=20 + limit=20, + skip_cache=True ) for album in albums or []: process_album(album, artist.artist_name, artist.spotify_artist_id, fallback_id if fallback_source == 'itunes' else None, 'spotify') @@ -2612,7 +2617,8 @@ class WatchlistScanner: albums = self.spotify_client.get_artist_albums( artist.similar_artist_spotify_id, album_type='album,single,ep', - limit=20 + limit=20, + skip_cache=True ) for album in albums or []: process_album(album, artist.similar_artist_name, artist.similar_artist_spotify_id, fallback_id if fallback_source == 'itunes' else None, 'spotify')