summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-11-04 02:44:57 +0100
committerChristian Soffke <christian.soffke@gmail.com>2023-11-11 00:36:14 +0100
commitd4f1247aecbb7129a06052746f8b113e74ebba2e (patch)
tree2ff98de54d2fdf78c341ea7d86aa0a8bb43dcf1b
parente9b4275d1f5b8d166fa772242af44b4d056ed482 (diff)
downloadrockbox-d4f1247aec.tar.gz
rockbox-d4f1247aec.zip
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
-rw-r--r--apps/playlist.c5
1 files changed, 5 insertions, 0 deletions
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,