SUMMARY When Shuffle is active, adding tracks to the playlist may interrupt currently played song and play a random other one STEPS TO REPRODUCE 1. Enable shuffle 2. Clear playlist 3. Add 1 track to playlist 4. Play the track 5. Add an album with many (e.g. 10+) tracks OBSERVED RESULT The current track stops playing, another random track starts playing. EXPECTED RESULT The current track continues playing ADDITIONAL INFORMATION This is because the new tracks are inserted into a random place in the playlist and if they, by chance, hit the same index as the currently playing track, the old track is stopped and the new track at that index is started. There's actually a low chance that the expected result happens (when by chance the insertion index is always different than the index of the current song).
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/593
Git commit fe01ad59ca132e8b447bb6b1edb4536eb69ec24a by Jack Hill. Committed on 21/06/2024 at 13:55. Pushed by jackh into branch 'master'. MediaPlayListProxyModel: only enqueue after the current track when shuffled and only after the current album when in album shuffle mode. Typically if a user wants to enqueue a track, they also want to hear the track at some point. Also fixes an issue where the enqueued track could sometimes enqueue at the index of the currently playing track, causing the current track to change. M +30 -5 autotests/mediaplaylistproxymodeltest.cpp M +14 -2 src/mediaplaylistproxymodel.cpp https://invent.kde.org/multimedia/elisa/-/commit/fe01ad59ca132e8b447bb6b1edb4536eb69ec24a