soulsync/tests/metadata
BoulderBadgeDad 50c17ec9f7 discography 'add to wishlist': batch the per-track ownership check (fixes ~15-30s/track)
clicking Download Discography → Add all to wishlist added ~1 track every 15-30s. trace: the
endpoint's per-track library-ownership check (track_already_owned → check_track_exists) ran the
LEGACY path — firing search_tracks for every title-variation × artist-variation, per track. on
a large library and an artist you own NOTHING of, STRATEGY-1 (indexed LIKE) always missed and
fell through to the fuzzy fallback (full-table scan), ~10-15 scans/track = the 15-30s. metadata
fetch was never the bottleneck (deezer returns each album in ~1s).

fix: pre-fetch the artist's owned tracks ONCE (get_candidate_albums_for_artist →
get_candidate_tracks_for_albums) and pass candidate_tracks to check_track_exists's batched
in-memory path — the same path the discography backfill job + completion-stream already use.
pass an EMPTY list (not None) when nothing is owned so the owns-nothing case still takes the
fast path → instant. per-track cost drops from ~20s to ~1ms.

safe: track_already_owned's only real caller is this endpoint; the new param is optional
(None = unchanged legacy behaviour for any other caller). normal ownership still detected (same
artist-variation breadth); the one divergence is a track owned ONLY via a compilation → a
harmless redundant wishlist add, which is the endpoint's explicitly-accepted failure mode and
already how the backfill job behaves. 4 new tests; 1134 discog/metadata/wishlist tests green.
2026-06-27 19:51:28 -07:00
..
test_album_artist_unknown.py Fix: import overwrites album-artist tag to "Unknown Artist" (#735) 2026-05-29 09:30:38 -07:00
test_album_mbid_cache.py
test_album_type_normalization.py
test_art_lookup.py Cover art: a sequel digit glued to a CJK title ('…サウンドトラック2') now blocks the wrong-album match 2026-06-18 08:24:54 -07:00
test_art_min_size.py Cover-art sources: skip low-res art (min-resolution guard) + max-res iTunes 2026-06-01 12:24:51 -07:00
test_art_sources.py Feature: preferred album-art source selection (opt-in, ordered, with fallback) 2026-06-01 11:45:07 -07:00
test_artist_resolution.py
test_artist_source_detail.py
test_artist_source_lookup.py Fix artist-detail showing wrong artist when a source id is duplicated 2026-06-05 07:24:51 -07:00
test_artwork_resolution.py #806 lock-in: archive.org outage cooldown for CAA originals 2026-06-06 23:36:14 -07:00
test_build_album_info_typed_path.py
test_cache_capacity_eviction.py Cache cap test: exercise the REAL _run_maintenance_write, not a stub 2026-05-30 23:31:35 -07:00
test_cache_maintenance_retry.py Handle transient SQLite IO during maintenance 2026-05-21 17:50:30 -07:00
test_deezer_cover_url_upgrade.py Embed highest-resolution album art across all art paths 2026-05-28 13:21:53 -07:00
test_deezer_search_query.py
test_deezer_track_cache_validity.py
test_discography_filters.py discography 'add to wishlist': batch the per-track ownership check (fixes ~15-30s/track) 2026-06-27 19:51:28 -07:00
test_discography_typed_path.py
test_enrichment_events.py
test_image_url_normalization.py feat(webui): cache artwork images on disk 2026-05-20 10:43:47 -07:00
test_metadata_album_tracks.py
test_metadata_artist_image.py
test_metadata_cache.py
test_metadata_cache_batch_lookup.py
test_metadata_discography.py #877: Download Discography filters mirror Artist Detail (fix dead EPs + add Live/Comp/Featured) 2026-06-15 21:30:55 -07:00
test_metadata_enrichment.py
test_metadata_gap_filler.py
test_metadata_musicmap.py
test_metadata_registry.py
test_multi_artist_tag_settings.py Multi-artist tags: Search → Download Now finally knows its metadata source (Netti93) 2026-06-09 17:20:16 -07:00
test_musicbrainz_client_query.py MusicBrainz manual search: field-scope the artist in non-strict mode (#754) 2026-05-31 10:05:24 -07:00
test_musicbrainz_search.py Fix: MusicBrainz artist discography capped at 25 releases 2026-05-28 12:00:05 -07:00
test_release_type.py
test_relevance.py Branch cleanup: lift manual-match helpers, fix length-pref ordering, profile-scope view toggle 2026-05-27 07:43:21 -07:00
test_runtime_bundle.py
test_track_number_format.py
test_typed_metadata_types.py