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.
This commit is contained in:
Broque Thomas 2026-04-05 14:09:14 -07:00
parent 8344cf2c7a
commit d4ce345ae2

View file

@ -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