From a8e307bb6aa21d5c4d7000eebd3d31b564eedb4a Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 2 Nov 2024 01:52:01 +0100 Subject: [PATCH] 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 --- src/playlist/playlist.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index e09cbc8e8..30bb5fc37 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -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) {