Skip to content

fix: persist song reordering and edits when saving a playlist#676

Open
thereisnotime wants to merge 2 commits into
eddyizm:developmentfrom
thereisnotime:fix/playlist-edit-not-persisting
Open

fix: persist song reordering and edits when saving a playlist#676
thereisnotime wants to merge 2 commits into
eddyizm:developmentfrom
thereisnotime:fix/playlist-edit-not-persisting

Conversation

@thereisnotime
Copy link
Copy Markdown

Fixes #584.

Supersedes #674 (which targeted main by mistake).

What was happening

PlaylistRepository.updatePlaylist() accepted a songsId parameter but passed null to the Subsonic updatePlaylist API. Any reordering or song additions/removals made in the editor were silently discarded — only the playlist name was ever sent to the server.

Root cause

The Subsonic updatePlaylist API supports adding or removing individual songs by index, but has no reorder operation. The existing code acknowledged this in a comment but left it unresolved.

Fix

updatePlaylist in the Subsonic API can't reorder, but createPlaylist with an existing playlistId replaces the full song list. After the rename call, a second call to createPlaylist(playlistId, null, songsId) now replaces the playlist contents with the edited/reordered song list.

Two independent calls — one updates the name, one replaces the songs — since the Subsonic API handles them as separate operations.

updatePlaylist() was calling the Subsonic updatePlaylist API with only
the name, ignoring the songsId parameter entirely. Reordering songs in
the editor had no effect on the server.

The Subsonic API has no reorder operation in updatePlaylist. The
workaround is createPlaylist with an existing playlistId, which replaces
the playlist's song list in full. Now updatePlaylist issues both calls:
one to rename and one to replace the song list.

Fixes eddyizm#584
@thereisnotime thereisnotime force-pushed the fix/playlist-edit-not-persisting branch from 6a1b521 to 4425cc1 Compare May 23, 2026 21:47
@eddyizm eddyizm added this to the Playlists milestone May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants