Skip to content

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

Closed
thereisnotime wants to merge 25 commits into
eddyizm:mainfrom
thereisnotime:fix/playlist-edit-not-persisting
Closed

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

Conversation

@thereisnotime
Copy link
Copy Markdown

Fixes #584.

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.

tvillega and others added 24 commits May 8, 2026 07:52
* feat: handle crashes gracefully

* fix: missing strings

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
* First tests

# Conflicts:
#	app/src/main/java/com/cappielloantonio/tempo/util/Preferences.kt
#	app/src/main/res/values-b+es+419/arrays.xml
#	app/src/main/res/values-de/arrays.xml
#	app/src/main/res/values-es-rES/arrays.xml
#	app/src/main/res/values-fr/arrays.xml
#	app/src/main/res/values-pl/arrays.xml
#	app/src/main/res/values-ru/arrays.xml
#	app/src/main/res/values/arrays.xml
#	app/src/main/res/xml/global_preferences.xml
#	app/src/tempus/java/com/cappielloantonio/tempo/service/MediaBrowserTree.kt

* Corrections after rebase

* final version

* Added index guard

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
Co-authored-by: eddyizm <eddyizm@gmail.com>
* Add eddyizm#576

* eddyizm#570 (arrays.xml)

* eddyizm#570 (strings.xml)

* Add eddyizm#595

* for you

* Add eddyizm#606

* Add eddyizm#609

* Add eddyizm#620 and rename replaygain

* typo

* Missing stuff

* Add eddyizm#617

* Add eddyizm#611

* Add eddyizm#614 (strings.xml)

* Add eddyizm#614 (arrays.xml)
…ddyizm#617)

* Implement sleep timer

* Revert "Implement sleep timer"

* Implement sleep timer

* Sleep timer adjustments and custom time option

* Sleep timer localizations, theming, and new features

1. Process-death survival 
2. End-of-track mode
3. Fade-out 
4. Theme-aware icon
5. Localized duration labels

* Sleep timer "End of track" fix

* Fade out fix

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
Refactor custom commands

Co-authored-by: eddyizm <eddyizm@gmail.com>
* feat: saving full playlist detail in db and created pinned playlist table to track faves

* chore: uncommented automigration

* feat: added sorting by date, song count, pinned, etc

* feat: added preference auto saving and apply to home view.

* feat: saving playlist id/name to download track

* feat: expands playlsit sorting and adds back pinned/faves
* Implement sleep timer

* Revert "Implement sleep timer"

* Implement sleep timer

* Sleep timer adjustments and custom time option

* feat: add lyrics to player quick actions

* Sleep timer localizations, theming, and new features

1. Process-death survival 
2. End-of-track mode
3. Fade-out 
4. Theme-aware icon
5. Localized duration labels

* Sleep timer "End of track" fix

* Fade out fix

* feat: add lyrics to player quick actions

---------

Co-authored-by: CtznSniiips <88013463+CtznSniiips@users.noreply.github.com>
Co-authored-by: eddyizm <eddyizm@gmail.com>
* chore(i18n): Update Spanish (Spain, es-ES) translation

* chore(i18n): Update Spanish (Spain, es-ES) translation

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
style: Add darker/AMOLED theme

Co-authored-by: eddyizm <eddyizm@gmail.com>
* feat: save radio list locally for offline access (eddyizm#520)

Cache internet radio stations to Room database on successful API fetch.
Fall back to cached data when server is unreachable (HTTP 504 or
network failure), ensuring the radio list remains available offline.

* fix: fall back to original radio media item when server is unreachable

When the Subsonic server is down, AutomotiveRepository.getInternetRadioStations()
throws an exception. Wrap the call with Futures.catchingAsync() to fall back
to the original media item so radio playback works offline.

---------

Co-authored-by: Rouven Volkmann <gitlab@rouven-volkmann.de>
* Initial working version of modified startQueue function that starts the first 10 songs before loading the rest

* Minor change to enqueue function to collect media details off the main thread
Tidied up startQueue function changes

* removed accidental duplicate queue task

* avoid duplicate calls

* removed imports used in testing

* remove the listener before running enqueue so we dont accidently run it multiple times if the player changes state before enqueue completes

---------

Co-authored-by: Arrillo Dev <opensource@arrillo.com>
Remove AA settings in degoogled flavor

Co-authored-by: eddyizm <eddyizm@gmail.com>
Limiting number of tracks in playlists

Co-authored-by: eddyizm <eddyizm@gmail.com>
…eForYouBuilder (eddyizm#640)

reduce code duplication

Co-authored-by: eddyizm <eddyizm@gmail.com>
* fix: equalizer glitching navigation

* fix: inconsistent navigation on equalizer

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
* feat: add settings for track number display

* feat: add track number on now playing screen

* chore: better description of setting

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
* feat: add drawer to landscape layout of crash activity
and remove the bottom navbar on landscape as well

* feat: add landscape layout to crash info fragment

* feat: add landscape layout to crash export fragment

* feat: add landscape layout to crash logs fragment

* fix: toolbar not initiated nor configured

---------

Co-authored-by: eddyizm <eddyizm@gmail.com>
…position (eddyizm#651)

If the current period is seekable, it is very likely that the audio
file is not being transcoded and that reloading the source would result
in playback being restarted from the start the file.

Fixes eddyizm#650.

Co-authored-by: eddyizm <eddyizm@gmail.com>
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
Copy link
Copy Markdown
Author

Superseded by #676 which targets the development branch.

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.

[BUG] - editing playlists doesn't seem to work (Navidrome)