From d4f1247aecbb7129a06052746f8b113e74ebba2e Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 4 Nov 2023 02:44:57 +0100 Subject: Playlists: Fix moving songs in reshuffled playlist The current index wasn't always correct after moving in a playlist with first index > 0 Change-Id: Ifbcc1e00ed0ec5b26e2176d7971cc5c1e15a8840 --- apps/playlist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/playlist.c b/apps/playlist.c index 1f31ec81c1..78d41ea45e 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -2749,6 +2749,11 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index) else /* Calculate index of desired position */ { new_index = (r+playlist->first_index)%playlist->amount; + + if ((new_index < playlist->first_index) && (new_index <= playlist->index)) + displace_current = true; + else if ((new_index >= playlist->first_index) && (playlist->index < playlist->first_index)) + displace_current = false; } result = add_track_to_playlist_unlocked(playlist, filename, -- cgit v1.2.3