Do not remove currently playing track when repopulating a dynamic playlist

This commit is contained in:
Mark Furneaux 2014-12-27 20:34:29 -05:00
parent 7278e7c4d0
commit c4daa227a7
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++;
}