Version: 2.3-GIT (using KDE 4.4.4)
I execute this command:
qdbus org.kde.amarok /TrackList AddTrack ~/music/track.ogg true
The expected behavior is, that the track ~/music/track.ogg is added to the playlist and played (because of the true, which says, that the track should be played immediately: http://xmms2.org/wiki/MPRIS#AddTrack). The track is added correctly and the last track is played. But in a sorted list it's very rare that the last track is the new track.
This issue was reported against the Audioplayercontrol runner as bug 226119 (the other bugs are runner related, but this one isn't).
Is this still valid with Amarok 2.4.3 or current git?
It is valid with Amarok-2.4-GIT (downloaded and compiled today).
The problem occurs using sorted lists and random play (it does not matter wether random album or random track is selected). Using sorted lists results in the last track being played and using the random option results in the current track being restarted.
I reopened the bug therefore.
Thank you for the feedback.
Setting status correctly, it was not closed.
Sorry, obviously I misinterpreted the bug's state.
This is actually an issue with the playlist implementation. The same bug can be seen if Amarok is stopped, the playlist is sorted, and a track that will be sorted to somewhere in the middle of the list is dragged to the "Add to playlist" zone of the context view.
Git commit 0e07efe5908f927ba20cfbcc46298985c372c819 by Alex Merry.
Committed on 11/06/2012 at 15:57.
Pushed by alexmerry into branch 'master'.
Play the correct track when inserting tracks into a sorted playlist
When Playlist::Controller::insertOptioned() is told to play the track
that has been inserted, it previously failed to account for the
relocation of the tracks when inserted into a sorted list. The last
track in the list would end up being played, rather than the first
M +7 -3 src/playlist/PlaylistController.cpp
M +1 -0 src/playlist/PlaylistModel.h
M +7 -0 src/playlist/proxymodels/AbstractModel.h
M +6 -0 src/playlist/proxymodels/ProxyBase.cpp
M +1 -0 src/playlist/proxymodels/ProxyBase.h
Note that it will always play the first track from the inserted list, rather than the inserted track that is highest up the playlist, if multiple tracks are inserted at once. This is probably not the right behaviour, but it is certainly better than before.