FS#12887 - Fix for wrong playlist order after moving tracks before current

Attached to Project: Rockbox
Opened by Juan Gonzalez (Nephiel) - Sunday, 28 July 2013, 16:25 GMT
Last edited by Solomon Peachy (pizza) - Wednesday, 24 July 2019, 18:25 GMT
Task Type Patches
Category Playlists
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


When moving a track within a playlist to any position before the currently playing track, the index of the currently playing track on the playlist gets shifted back by 1. This causes two problems:

-The playlist shows a wrong track as the current track being played
-The currently playing track is played once more when finished

The only exception is when moving to the first position in the playlist, since that is handled as a prepend and works as expected.

AFAIK this issue affects all players and has been present at least since 3.6 (see #FS11376

Attached is a patch against 49bcf35 that (hopefully) fixes this issue by comparing the display indexes of the positions we're moving from/to and the currently playing track, incrementing the playlist index when neccessary.
This task depends upon

Closed by  Solomon Peachy (pizza)
Wednesday, 24 July 2019, 18:25 GMT
Reason for closing:  Accepted
Additional comments about closing:  Better late than never, this has finally been committed as 7bef453e.
Comment by Juan Gonzalez (Nephiel) - Sunday, 28 July 2013, 17:52 GMT