fix: persist song reordering and edits when saving a playlist#676
Open
thereisnotime wants to merge 2 commits into
Open
fix: persist song reordering and edits when saving a playlist#676thereisnotime wants to merge 2 commits into
thereisnotime wants to merge 2 commits into
Conversation
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
6a1b521 to
4425cc1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #584.
Supersedes #674 (which targeted main by mistake).
What was happening
PlaylistRepository.updatePlaylist()accepted asongsIdparameter but passednullto the SubsonicupdatePlaylistAPI. 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
updatePlaylistAPI 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
updatePlaylistin the Subsonic API can't reorder, butcreatePlaylistwith an existingplaylistIdreplaces the full song list. After the rename call, a second call tocreatePlaylist(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.