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:
@@ -2009,8 +2009,7 @@ void Playlist::ReshuffleIndices() {
|
|||||||
std::shuffle(shuffled_album_keys.begin(), shuffled_album_keys.end(), std::mt19937(rd()));
|
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
|
// 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_row() != -1) {
|
||||||
if (current_virtual_index_ != -1 || current_row() != -1) {
|
|
||||||
const QString key = items_[current_row()]->Metadata().AlbumKey();
|
const QString key = items_[current_row()]->Metadata().AlbumKey();
|
||||||
const qint64 pos = shuffled_album_keys.indexOf(key);
|
const qint64 pos = shuffled_album_keys.indexOf(key);
|
||||||
if (pos >= 1) {
|
if (pos >= 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user