soulsync/tests/search
BoulderBadgeDad bcd69c8baa Multi-artist tags: Search → Download Now finally knows its metadata source (Netti93)
Third round of the multi-artist report. The earlier fixes (Deezer contributors
upgrade, _artists_list, feat_in_title/artist_separator) were all in place and
correct — but gated on source == 'deezer', and on the real Search → Download
Now path NOTHING carried the source: core/search/sources.py serialized tracks
with no source field, search.js's enrichedTrack didn't add one, so
get_import_source() resolved '' and the whole Deezer-specific block silently
skipped. Files were tagged with only the primary artist until a Retag (which
rebuilds context with the source set — exactly why retagging always fixed it).
The earlier tests passed because they set context['source'] directly — the one
field the real flow never had (same mock-drift as the #823 append tests).

Reproduced with Netti93's exact track (deezer 3966840171) through the real
extract_source_metadata: before — source '', artists ['August Burns Red'];
after — source 'deezer', contributors fetched, artists ['August Burns Red',
'Polaris'], title 'Sonic Salvation (feat. Polaris)' per feat_in_title.

Fix, three layers:
- core/search/sources.py: serialized tracks/albums/artists carry "source"
  (the canonical name the orchestrator already passes; '' when unnamed).
- core/imports/context.py get_import_source: also reads '_source' from the
  nested dicts (track_info/original_search/album/artist) — additionally fixes
  the discography/wishlist flows, which always passed '_source' that nothing
  read.
- search.js: enrichedTrack + the album-download path carry source through to
  the download task.

Tests: real-payload staging-shaped contexts (source in track_info, '_source'
shape, and the pre-fix sourceless shape staying safe — mocked Deezer client),
serializer source-field tests, resolver fallback tests; exact-shape serializer
tests updated for the new key. 1977 import/metadata/search tests pass (the
only 2 failures are the known soundcloud ones).
2026-06-09 17:20:16 -07:00
..
__init__.py Lift /api/search and /api/enhanced-search/* into core/search/ 2026-04-27 15:07:11 -07:00
test_search_basic.py Basic search: visual overhaul + per-source picker in hybrid mode 2026-05-28 10:22:07 -07:00
test_search_by_id.py Search: extend pasted-link resolution to Discogs (#813) 2026-06-08 14:37:48 -07:00
test_search_cache.py Search cache: preserve falsy provider returns to match original behavior 2026-04-27 15:19:52 -07:00
test_search_library_check.py Lift /api/search and /api/enhanced-search/* into core/search/ 2026-04-27 15:07:11 -07:00
test_search_orchestrator.py #798: Spotify Free metadata mode — backend (opt-in, shared spotify tables) 2026-06-05 13:32:37 -07:00
test_search_sources.py Multi-artist tags: Search → Download Now finally knows its metadata source (Netti93) 2026-06-09 17:20:16 -07:00
test_search_stream.py Cin-6: Rename soulseek_client global → download_orchestrator 2026-05-04 23:23:32 -07:00