From 6ceedc8fd4d1ff9e8ea168e773c0216fc077081c Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 21 Apr 2026 21:12:22 -0700 Subject: [PATCH] Fix manual discovery fixes lost after restart for non-Spotify users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five update_match endpoints hardcoded the provider as 'spotify' when saving manual fixes to the discovery cache, but the re-discovery worker queries the cache with _get_active_discovery_source() — the user's actual primary. If the primary was Deezer/iTunes/Discogs/Hydrabase, the provider column never matched, so every manual fix looked like it vanished on restart. Replaced 'spotify' with _get_active_discovery_source() at all 5 sites: - Tidal update_match (web_server.py:34569) - Deezer update_match (web_server.py:36235) - Spotify Public update_match (web_server.py:37084) - YouTube update_match (web_server.py:38037) - Discovery Pool fix (web_server.py:49787) Now symmetric with how the auto-discovery workers already save. Spotify- primary users see no change (the hardcoded value matched their source). Version bumped to 2.38 with changelog + version-info entries. --- web_server.py | 21 +++++++++++++++------ webui/static/helper.js | 9 +++++++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/web_server.py b/web_server.py index 95ce0d3c..a6fdbf8d 100644 --- a/web_server.py +++ b/web_server.py @@ -37,7 +37,7 @@ _log_dir = Path(_log_path).parent logger = setup_logging(_log_level, _log_path) # App version — single source of truth for backup metadata, version-info endpoint, etc. -_SOULSYNC_BASE_VERSION = "2.37" +_SOULSYNC_BASE_VERSION = "2.38" def _build_version_string(): """Append short commit hash to version when available (e.g. 2.35+abc1234).""" @@ -22656,6 +22656,15 @@ def get_version_info(): "title": "What's New in SoulSync", "subtitle": f"Version {SOULSYNC_VERSION} — Latest Changes", "sections": [ + { + "title": "Manual Discovery Fixes Persist Across Restart", + "description": "When you manually fix a discovery match, the fix is now saved under your active metadata source instead of always 'spotify' — so Deezer/iTunes/Discogs/Hydrabase users' fixes actually survive restart and re-scan", + "features": [ + "• Affected Tidal, Deezer, Spotify Public, YouTube, and Discovery Pool manual fixes", + "• Symmetric with how the auto-discovery worker saves — no more mismatch", + "• Existing Spotify-primary users unaffected (the hardcoded value matched their source)", + ], + }, { "title": "Watchlist Content Filters Fixed", "description": "Global Override settings and live-version detection now behave the way the UI implies", @@ -34566,7 +34575,7 @@ def update_tidal_discovery_match(): } cache_db = get_database() cache_db.save_discovery_cache_match( - cache_key[0], cache_key[1], 'spotify', 1.0, matched_data, + cache_key[0], cache_key[1], _get_active_discovery_source(), 1.0, matched_data, original_name, original_artist ) logger.info(f"Manual fix saved to discovery cache: {original_name} by {original_artist}") @@ -36232,7 +36241,7 @@ def update_deezer_discovery_match(): } cache_db = get_database() cache_db.save_discovery_cache_match( - cache_key[0], cache_key[1], 'spotify', 1.0, matched_data, + cache_key[0], cache_key[1], _get_active_discovery_source(), 1.0, matched_data, original_name, original_artist ) logger.info(f"Manual fix saved to discovery cache: {original_name} by {original_artist}") @@ -37081,7 +37090,7 @@ def update_spotify_public_discovery_match(): } cache_db = get_database() cache_db.save_discovery_cache_match( - cache_key[0], cache_key[1], 'spotify', 1.0, matched_data, + cache_key[0], cache_key[1], _get_active_discovery_source(), 1.0, matched_data, original_name, original_artist ) logger.info(f"Manual fix saved to discovery cache: {original_name} by {original_artist}") @@ -38034,7 +38043,7 @@ def update_youtube_discovery_match(): } cache_db = get_database() cache_db.save_discovery_cache_match( - cache_key[0], cache_key[1], 'spotify', 1.0, matched_data, + cache_key[0], cache_key[1], _get_active_discovery_source(), 1.0, matched_data, original_name, original_artist ) logger.info(f"Manual fix saved to discovery cache: {original_name} by {original_artist}") @@ -49784,7 +49793,7 @@ def fix_discovery_pool_track(): if row: cache_key = _get_discovery_cache_key(row['track_name'], row['artist_name']) database.save_discovery_cache_match( - cache_key[0], cache_key[1], 'spotify', 1.0, matched_data, + cache_key[0], cache_key[1], _get_active_discovery_source(), 1.0, matched_data, row['track_name'], row['artist_name'] ) except Exception: diff --git a/webui/static/helper.js b/webui/static/helper.js index 34d186b4..cfb5e81f 100644 --- a/webui/static/helper.js +++ b/webui/static/helper.js @@ -3599,6 +3599,11 @@ function closeHelperSearch() { // ═══════════════════════════════════════════════════════════════════════════ const WHATS_NEW = { + '2.38': [ + // --- April 21, 2026 (late) --- + { date: 'April 21, 2026 (late)' }, + { title: 'Fix Manual Discovery Fixes Lost After Restart (Non-Spotify Users)', desc: 'When you clicked Fix on a discovery track and picked a manual match, the cache save hardcoded the provider as "spotify" regardless of your configured primary metadata source. On re-scan, the worker queried the cache with your actual primary (Deezer, iTunes, Discogs, Hydrabase) and missed the fix entirely. All 5 save sites (Tidal / Deezer / Spotify Public / YouTube / Discovery Pool) now use the active primary source, matching what the automatic workers already do', page: 'sync' }, + ], '2.37': [ // --- April 21, 2026 (evening) --- { date: 'April 21, 2026 (evening)' }, @@ -3786,12 +3791,12 @@ const WHATS_NEW = { function _getCurrentVersion() { const btn = document.querySelector('.version-button'); - return btn ? btn.textContent.trim().replace('v', '') : '2.37'; + return btn ? btn.textContent.trim().replace('v', '') : '2.38'; } function _getLatestWhatsNewVersion() { const versions = Object.keys(WHATS_NEW).sort((a, b) => parseFloat(b) - parseFloat(a)); - return versions[0] || '2.37'; + return versions[0] || '2.38'; } function openWhatsNew() {