Fix #792: per-source discovery syncs ignored the sync-mode setting
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.
This commit is contained in:
parent
65c9948c78
commit
a893f618c7
1 changed files with 9 additions and 2 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue