Merge pull request #4465 from Mikah89/fix_album_shuffle_issue

Fix album shuffle issue
This commit is contained in:
ArnaudBienner 2014-08-13 10:16:28 +02:00
commit ba3998e79b
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 was 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) {