Playlist: Only move album for current row first

The logic was flawed as current_virtual_index_ can be set even when current_row isn't causing crash.

Fixes #1588
This commit is contained in:
Jonas Kvinge
2024-11-02 01:52:01 +01:00
parent a30aca4759
commit a8e307bb6a

View File

@@ -2009,8 +2009,7 @@ void Playlist::ReshuffleIndices() {
std::shuffle(shuffled_album_keys.begin(), shuffled_album_keys.end(), std::mt19937(rd()));
// If the user is currently playing a song, force its album to be first
// Or if the song was not playing but it was selected, force its album to be first.
if (current_virtual_index_ != -1 || current_row() != -1) {
if (current_row() != -1) {
const QString key = items_[current_row()]->Metadata().AlbumKey();
const qint64 pos = shuffled_album_keys.indexOf(key);
if (pos >= 1) {