From fb7b3b029574b951f8628071d9935c5b840962e0 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 4 May 2021 23:16:18 +0200 Subject: [PATCH] Revert "Shuffle all songs instead of from the current to the end" This reverts commit 316a3d51eebc1de5ddaea1764896c00e007d1f60. --- src/playlist/playlist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 0f8c2f5f1..b01e2dbcc 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -1875,8 +1875,11 @@ void Playlist::ReshuffleIndices() { return; } + // If the user is already playing a song, advance the begin iterator to only shuffle items that haven't been played yet. QList::iterator begin = virtual_items_.begin(); QList::iterator end = virtual_items_.end(); + if (current_virtual_index_ != -1) + std::advance(begin, current_virtual_index_ + 1); std::random_device rd; std::mt19937 g(rd());