mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-28 16:20:26 +01:00
Move the currently playing song to the top when the playlist is manually shuffled
Fixes #304
This commit is contained in:
parent
4208b512f8
commit
42c62206c8
@ -1654,6 +1654,11 @@ void Playlist::Shuffle() {
|
||||
PlaylistItemList new_items(items_);
|
||||
|
||||
int begin = 0;
|
||||
if (current_item_index_.isValid()) {
|
||||
if (new_items[0] != new_items[current_item_index_.row()])
|
||||
std::swap(new_items[0], new_items[current_item_index_.row()]);
|
||||
begin = 1;
|
||||
}
|
||||
|
||||
const int count = items_.count();
|
||||
for (int i = begin; i < count; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user