From d4ce345ae2273dde7fc6b5ecb699c5e841bf4394 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sun, 5 Apr 2026 14:09:14 -0700 Subject: [PATCH] Backfill all metadata source IDs during manual watchlist scan Manual scan path was only backfilling the active provider (e.g., only Spotify IDs if Spotify was active). Now matches the auto-scan behavior: backfills iTunes, Deezer, Spotify (if auth'd), and Discogs (if token) for all watchlist artists before scanning begins. --- web_server.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/web_server.py b/web_server.py index 40464f14..33458305 100644 --- a/web_server.py +++ b/web_server.py @@ -37822,16 +37822,22 @@ def start_watchlist_scan(): scanner = WatchlistScanner(metadata_service=metadata_service) # PROACTIVE ID BACKFILLING (cross-provider support) - # Before scanning, ensure all artists have IDs for the current provider + # Before scanning, ensure all artists have IDs for ALL available sources + providers_to_backfill = ['itunes', 'deezer'] + if spotify_client and spotify_client.is_spotify_authenticated(): + providers_to_backfill.append('spotify') try: - active_provider = metadata_service.get_active_provider() - print(f"🔍 Checking for missing {active_provider} IDs in watchlist...") - scanner._backfill_missing_ids(watchlist_artists, active_provider) - except Exception as backfill_error: - print(f"⚠️ Error during ID backfilling: {backfill_error}") - import traceback - traceback.print_exc() - # Continue with scan even if backfilling fails + if config_manager.get('discogs.token', ''): + providers_to_backfill.append('discogs') + except Exception: + pass + for _bf_provider in providers_to_backfill: + try: + print(f"🔍 Checking for missing {_bf_provider} IDs in watchlist...") + scanner._backfill_missing_ids(watchlist_artists, _bf_provider) + except Exception as backfill_error: + print(f"⚠️ Error during {_bf_provider} ID backfilling: {backfill_error}") + # Continue with next provider # IMAGE BACKFILL — fix watchlist artists with missing images # Uses DB-only lookups (metadata cache + album art) — no API calls