Commit 2ff06766 authored by Michael Pyne's avatar Michael Pyne
Browse files

playlist: Play whole album when playback started in album-random mode.

Previously, the track the user double-clicked would be played, then
album random playback would start with the next track and succeeding
tracks after.

(cherry picked from commit 1c698b3a)
parent 04b631c3
......@@ -717,6 +717,18 @@ void Playlist::refillRandomList()
[](PlaylistItem *a, PlaylistItem *b) {
return a->file().tag()->album() < b->file().tag()->album();
// If there is an item playing from our playlist already, move its
// album to the front
const auto wasPlaying = playingItem();
if(wasPlaying && wasPlaying->playlist() == this) {
const auto playingAlbum = wasPlaying->file().tag()->album();
std::stable_partition(randomItems.begin(), randomItems.end(),
[playingAlbum](const PlaylistItem *item) {
return item->file().tag()->album() == playingAlbum;
std::swap(m_randomSequence, randomItems);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment