Fix manual discovery fixes lost after restart for non-Spotify users

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.
This commit is contained in:
Broque Thomas 2026-04-21 21:12:22 -07:00
parent d0ee9c73b3
commit 6ceedc8fd4
2 changed files with 22 additions and 8 deletions

View file

@ -37,7 +37,7 @@ _log_dir = Path(_log_path).parent
logger = setup_logging(_log_level, _log_path) logger = setup_logging(_log_level, _log_path)
# App version — single source of truth for backup metadata, version-info endpoint, etc. # 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(): def _build_version_string():
"""Append short commit hash to version when available (e.g. 2.35+abc1234).""" """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", "title": "What's New in SoulSync",
"subtitle": f"Version {SOULSYNC_VERSION} — Latest Changes", "subtitle": f"Version {SOULSYNC_VERSION} — Latest Changes",
"sections": [ "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", "title": "Watchlist Content Filters Fixed",
"description": "Global Override settings and live-version detection now behave the way the UI implies", "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 = get_database()
cache_db.save_discovery_cache_match( 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 original_name, original_artist
) )
logger.info(f"Manual fix saved to discovery cache: {original_name} by {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 = get_database()
cache_db.save_discovery_cache_match( 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 original_name, original_artist
) )
logger.info(f"Manual fix saved to discovery cache: {original_name} by {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 = get_database()
cache_db.save_discovery_cache_match( 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 original_name, original_artist
) )
logger.info(f"Manual fix saved to discovery cache: {original_name} by {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 = get_database()
cache_db.save_discovery_cache_match( 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 original_name, original_artist
) )
logger.info(f"Manual fix saved to discovery cache: {original_name} by {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: if row:
cache_key = _get_discovery_cache_key(row['track_name'], row['artist_name']) cache_key = _get_discovery_cache_key(row['track_name'], row['artist_name'])
database.save_discovery_cache_match( 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'] row['track_name'], row['artist_name']
) )
except Exception: except Exception:

View file

@ -3599,6 +3599,11 @@ function closeHelperSearch() {
// ═══════════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════════
const WHATS_NEW = { 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': [ '2.37': [
// --- April 21, 2026 (evening) --- // --- April 21, 2026 (evening) ---
{ date: 'April 21, 2026 (evening)' }, { date: 'April 21, 2026 (evening)' },
@ -3786,12 +3791,12 @@ const WHATS_NEW = {
function _getCurrentVersion() { function _getCurrentVersion() {
const btn = document.querySelector('.version-button'); 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() { function _getLatestWhatsNewVersion() {
const versions = Object.keys(WHATS_NEW).sort((a, b) => parseFloat(b) - parseFloat(a)); 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() { function openWhatsNew() {