Merge pull request #4679 from TheUbuntuGuy/master

Do not remove currently playing track when repopulating a dynamic playlist
This commit is contained in:
Andreas 2015-04-10 22:41:44 +02:00
commit 25e73d5714
1 changed files with 5 additions and 3 deletions

View File

@ -1761,7 +1761,7 @@ void Playlist::ExpandDynamicPlaylist() {
}
void Playlist::RemoveItemsNotInQueue() {
if (queue_->is_empty()) {
if (queue_->is_empty() && !current_item_index_.isValid()) {
RemoveItemsWithoutUndo(0, items_.count());
return;
}
@ -1771,7 +1771,7 @@ void Playlist::RemoveItemsNotInQueue() {
// Find a place to start - first row that isn't in the queue
forever {
if (start >= rowCount()) return;
if (!queue_->ContainsSourceRow(start)) break;
if (!queue_->ContainsSourceRow(start) && current_row() != start) break;
start++;
}
@ -1780,7 +1780,9 @@ void Playlist::RemoveItemsNotInQueue() {
int count = 1;
forever {
if (start + count >= rowCount()) break;
if (queue_->ContainsSourceRow(start + count)) break;
if (queue_->ContainsSourceRow(start + count) ||
current_row() == start + count)
break;
count++;
}