complemented condition inside reshuffleindices function to take into account the selected track

This commit is contained in:
Helder Martins 2014-07-27 23:07:50 +01:00
parent 0976cc7e5c
commit 56fc242520
1 changed files with 4 additions and 2 deletions

View File

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