soulsync/core
Broque Thomas cf143f70af Batch discography completion matching against pre-fetched candidates
Artist detail pages ran check_album_exists_with_editions and check_track_exists
per discography item, each firing 5+ title variations times 3 artist variations
of fuzzy LIKE searches plus fallback broad-artist queries. For a 30-album artist
that was ~450 SQL round-trips just to answer "which of these do I own."

Hoist the artist's library albums and tracks into memory once per request via
two new helpers — get_candidate_albums_for_artist and get_candidate_tracks_for_albums —
and thread them through as optional candidate_albums / candidate_tracks params on
check_album_exists_with_editions, check_album_exists_with_completeness,
check_track_exists, check_album_completion, and check_single_completion.

Batched path scores the same _calculate_album_confidence / _calculate_track_confidence
against the in-memory list, preserving Smart Edition Matching and accuracy.
Title-only cross-artist fallback still fires for collaborative-album edge cases.
None on either param preserves legacy per-item SQL behavior for unaffected callers.

Applied to both /api/library/completion-stream (library artist detail page) and
iter_artist_discography_completion_events (Artists search page). Timing logs
added to confirm the pre-fetch cost and loop elapsed time.

On a Kendrick page load, per-album resolution drops from ~8 seconds to under
the 50ms streaming sleep floor. Observed ~100x SQL reduction on the happy path.
2026-04-21 10:47:47 -07:00
..
repair_jobs Add Discography Backfill maintenance job 2026-04-20 22:04:38 -07:00
acoustid_client.py Fix AcoustID test connection falsely failing for valid API keys 2026-04-13 09:37:50 -07:00
acoustid_verification.py Fix AcoustID high-confidence skip letting wrong files through 2026-04-20 12:46:01 -07:00
album_consistency.py Picard-style release preference scoring for MusicBrainz matching 2026-04-16 13:29:04 -07:00
api_call_tracker.py Persist API call history, record rate limit events, fix Spotify re-auth issues 2026-04-05 12:36:58 -07:00
audiodb_client.py Add API Rate Monitor dashboard with real-time speedometer gauges 2026-04-02 10:46:43 -07:00
audiodb_worker.py Add genre whitelist for filtering junk tags during enrichment 2026-04-18 20:23:53 -07:00
auto_import_worker.py Use parent folder name as artist override in auto-import 2026-04-20 22:56:34 -07:00
automation_engine.py Add Run Script action to automation engine 2026-04-09 18:20:29 -07:00
database_update_worker.py More dead code removal after desktop app removal 2026-04-17 20:06:24 +03:00
deezer_client.py Fix playlist cover art not syncing to Plex/Jellyfin from Deezer and other sources 2026-04-15 10:25:38 -07:00
deezer_download_client.py Add Your Albums — multi-source liked albums pool (Spotify, Tidal, Deezer) 2026-04-13 23:02:37 -07:00
deezer_worker.py Add genre whitelist for filtering junk tags during enrichment 2026-04-18 20:23:53 -07:00
discogs_client.py Fix Discogs cache — add field extractor, wire worker caching, browser UI 2026-04-02 19:47:36 -07:00
discogs_worker.py Add genre whitelist for filtering junk tags during enrichment 2026-04-18 20:23:53 -07:00
download_orchestrator.py Enable Lidarr as production-ready download source 2026-04-20 07:24:04 -07:00
genius_client.py Add API Rate Monitor dashboard with real-time speedometer gauges 2026-04-02 10:46:43 -07:00
genius_worker.py Improve graceful shutdown and rollback safety 2026-04-12 15:17:18 +03:00
genre_filter.py Expand default genre whitelist from 223 to 272 genres 2026-04-18 20:32:49 -07:00
hifi_client.py Add per-source quality fallback toggle for streaming downloads (#187) 2026-03-24 11:42:47 -07:00
hydrabase_client.py Add missing _get_artist_image_from_albums to HydrabaseClient 2026-03-23 17:54:21 -07:00
hydrabase_worker.py Improve graceful shutdown and rollback safety 2026-04-12 15:17:18 +03:00
itunes_client.py Fix iTunes album tracks failing on region-restricted releases 2026-04-20 11:10:54 -07:00
itunes_worker.py Add genre whitelist for filtering junk tags during enrichment 2026-04-18 20:23:53 -07:00
jellyfin_client.py Fix Jellyfin playlist track fetch truncating at default API limit 2026-04-13 15:17:52 -07:00
lastfm_client.py Add Last.fm Track Radio to Discover page 2026-04-14 23:41:36 -07:00
lastfm_worker.py fix: stop enrichment workers from re-processing rows forever 2026-04-19 15:22:24 -07:00
lidarr_download_client.py Enable Lidarr as production-ready download source 2026-04-20 07:24:04 -07:00
listenbrainz_client.py Remove emojis from all Python log and print statements 2026-04-11 21:11:02 -07:00
listenbrainz_manager.py Add Last.fm Track Radio to Discover page 2026-04-14 23:41:36 -07:00
listening_stats_worker.py fix: batch N+1 queries in listening stats worker 2026-04-19 15:22:25 -07:00
lyrics_client.py Remove emojis from all Python log and print statements 2026-04-11 21:11:02 -07:00
matching_engine.py Reject junk artist Soulseek results and cancel downloads on wishlist clear 2026-04-17 12:24:50 -07:00
metadata_cache.py fix: batch metadata cache entity lookups 2026-04-19 15:22:24 -07:00
metadata_service.py Batch discography completion matching against pre-fetched candidates 2026-04-21 10:47:47 -07:00
musicbrainz_client.py Add API Rate Monitor dashboard with real-time speedometer gauges 2026-04-02 10:46:43 -07:00
musicbrainz_search.py Add MusicBrainz search tab, wider global search, bump to v2.32 2026-04-18 02:06:27 -07:00
musicbrainz_service.py Add metadata cache maintenance and health monitoring 2026-03-30 07:40:20 -07:00
musicbrainz_worker.py fix: stop enrichment workers from re-processing rows forever 2026-04-19 15:22:24 -07:00
navidrome_client.py Fix Navidrome full refresh importing albums from unselected music folders 2026-04-20 12:52:37 -07:00
personalized_playlists.py Replace all legacy metadata_service imports with canonical functions 2026-04-10 12:52:36 -07:00
plex_client.py Fix playlist cover art not syncing to Plex/Jellyfin from Deezer and other sources 2026-04-15 10:25:38 -07:00
qobuz_client.py Reject Qobuz 30-second sample/preview downloads 2026-04-15 20:41:48 -07:00
qobuz_worker.py fix: stop enrichment workers from re-processing rows forever 2026-04-19 15:22:24 -07:00
repair_worker.py Add Discography Backfill maintenance job 2026-04-20 22:04:38 -07:00
replaygain.py Add ReplayGain analysis and tagging support 2026-04-14 19:09:25 -07:00
seasonal_discovery.py Remove emojis from all Python log and print statements 2026-04-11 21:11:02 -07:00
soulid_worker.py Improve graceful shutdown and rollback safety 2026-04-12 15:17:18 +03:00
soulseek_client.py Add first-run setup wizard and fix download path reloading 2026-04-11 22:45:16 -07:00
soulsync_client.py Add SoulSync standalone library — no media server required 2026-04-17 20:34:55 -07:00
spotify_client.py Fix Spotify OAuth stealing ports in Docker on fresh installs 2026-04-18 20:46:22 -07:00
spotify_public_scraper.py Add Spotify Link tab for public playlist/album scraping without API credentials 2026-03-15 21:25:05 -07:00
spotify_worker.py Add genre whitelist for filtering junk tags during enrichment 2026-04-18 20:23:53 -07:00
tag_writer.py Add ReplayGain analysis and tagging support 2026-04-14 19:09:25 -07:00
tidal_client.py Fix playlist cover art not syncing to Plex/Jellyfin from Deezer and other sources 2026-04-15 10:25:38 -07:00
tidal_download_client.py Improve Tidal download failure diagnostics and error messaging 2026-04-14 14:07:50 -07:00
tidal_worker.py fix: stop enrichment workers from re-processing rows forever 2026-04-19 15:22:24 -07:00
watchlist_scanner.py Add per-artist metadata source override for watchlist scans 2026-04-18 16:05:05 -07:00
web_scan_manager.py Add SoulSync standalone library — no media server required 2026-04-17 20:34:55 -07:00
wishlist_service.py Fix wishlisted tracks showing 'Unknown Album' with no cover art 2026-03-18 14:23:53 -07:00
worker_utils.py Improve graceful shutdown and rollback safety 2026-04-12 15:17:18 +03:00
youtube_client.py Add first-run setup wizard and fix download path reloading 2026-04-11 22:45:16 -07:00