From a893f618c70d4af9a2dd9da4c681b6a623fd574b Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Thu, 4 Jun 2026 16:18:54 -0700 Subject: [PATCH] Fix #792: per-source discovery syncs ignored the sync-mode setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The real path for discovery-modal syncs (Spotify-Public/Tidal/Deezer/Qobuz/ YouTube/iTunes-link/ListenBrainz/Beatport) is _start_source_sync -> _submit_sync_task, which called _run_sync_task WITHOUT a sync_mode — so it used the 'replace' default and never consulted the setting. (My earlier fix only covered /api/sync/start, which these endpoints don't use — hence the log still showing POST /api/spotify-public/sync/start ... mode: replace.) _submit_sync_task now resolves the configured default via normalize_sync_mode and passes it through, so all source syncs honor Settings > Playlist sync mode. --- web_server.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web_server.py b/web_server.py index f4a897ce..cb869f23 100644 --- a/web_server.py +++ b/web_server.py @@ -21053,10 +21053,17 @@ def _get_source_playlist_states(states, error_label, info_log_label=None): def _submit_sync_task(sync_playlist_id, playlist_name, spotify_tracks, playlist_image_url): """Submit a sync to the shared executor (closes over sync_executor / _run_sync_task / get_current_profile_id so the lifted start_sync helper - stays free of those globals).""" + stays free of those globals). + + Used by ALL per-source discovery syncs (Spotify-Public/Tidal/Deezer/Qobuz/ + YouTube/iTunes-link/ListenBrainz/Beatport). These have no per-request mode + selector, so honor the configured default (Settings > Playlist sync mode) — + otherwise they always ran 'replace' regardless of the setting (#792).""" + from core.sync.playlist_edit import normalize_sync_mode + _mode = normalize_sync_mode(None, config_manager.get('playlist_sync.mode', 'replace')) return sync_executor.submit( _run_sync_task, sync_playlist_id, playlist_name, spotify_tracks, - None, get_current_profile_id(), playlist_image_url, + None, get_current_profile_id(), playlist_image_url, _mode, )