soulsync/core/metadata
Broque Thomas 7316646b01 Extract multi-source search; Enhance Quality matches Redownload coverage
Track Redownload had been doing parallel multi-source metadata search
across every configured source the whole time; Enhance Quality was
running a single-source primary fallback that returned junk matches
with empty fields when the primary was iTunes (Discord report:
"unknown artist - unknown album - unknown track" wishlist entries
for users with neither Spotify nor Deezer connected).

Lift the redownload search into core/metadata/multi_source_search.py
and point both flows at it. Same scoring, same per-source query
optimization (Deezer's structured artist:/track: form), same
current-match flagging via stored source IDs.

ArtistQualityDeps now takes get_metadata_search_sources (returns
[(name, client), ...] for every configured source) instead of the
single-primary get_metadata_fallback_client + get_metadata_fallback_source.
Spotify direct-lookup stays as a fast-path optimization (only Spotify
exposes get_track_details(id) returning rich raw payload); when it
doesn't fire, the multi-source parallel search picks the cross-source
best match. Empty-field matches still rejected before wishlist add.

Tests: _build_deps helper updated to accept the new search_sources
contract while preserving fallback_client/fallback_source ergonomics.
Reframed tests for the new semantics — direct-lookup is no longer
gated on Spotify being the active primary; failure reason now lists
every searched source. Added a test pinning the no-sources-configured
prompt. 17/17 quality tests green, 2128/2128 full suite green.
2026-05-06 11:26:22 -07:00
..
__init__.py Move image URL normalization into metadata helpers 2026-05-02 22:02:36 +03:00
album_mbid_cache.py Fix album MBID inconsistency: detector + persistent release-MBID cache 2026-05-03 17:16:39 -07:00
album_tracks.py Migrate album-info builders to typed Album path 2026-05-03 22:53:12 -07:00
artist_image.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
artwork.py Move image URL normalization into metadata helpers 2026-05-02 22:02:36 +03:00
cache.py Move metadata API into package 2026-04-29 08:10:18 +03:00
common.py Tighten metadata and import safety 2026-04-27 20:28:05 +03:00
completion.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
discography.py Migrate discography + quality scanner to typed Album path 2026-05-04 08:12:40 -07:00
enrichment.py fix post-download tagging, and enable tagging for hifi 2026-05-02 07:50:12 -06:00
lookup.py Move metadata API into package 2026-04-29 08:10:18 +03:00
lyrics.py Move shared metadata helpers into package 2026-04-27 19:54:44 +03:00
multi_source_search.py Extract multi-source search; Enhance Quality matches Redownload coverage 2026-05-06 11:26:22 -07:00
registry.py Split metadata source and Spotify status 2026-05-02 22:02:00 +03:00
service.py Move metadata API into package 2026-04-29 08:10:18 +03:00
similar_artists.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
source.py Fix album MBID inconsistency: detector + persistent release-MBID cache 2026-05-03 17:16:39 -07:00
status.py Make Spotify status updates event-driven 2026-05-02 22:02:01 +03:00
types.py Add Qobuz + Tidal album converters 2026-05-03 22:30:19 -07:00