Skip to content

Commit

Permalink
Playlist: Only move album for current row first
Browse files Browse the repository at this point in the history
The logic was flawed as current_virtual_index_ can be set even when current_row isn't causing crash.

Fixes #1588
  • Loading branch information
jonaski committed Nov 2, 2024
1 parent a30aca4 commit a8e307b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/playlist/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a8e307b

Please sign in to comment.