Clear now playing in MainWindow::MediaPlaying() instead

Fixes #548
This commit is contained in:
Jonas Kvinge 2020-09-29 17:38:00 +02:00
parent e22d463d11
commit e390f3a399
2 changed files with 5 additions and 3 deletions

View File

@ -1261,6 +1261,8 @@ void MainWindow::MediaPlaying() {
track_position_timer_->start();
track_slider_timer_->start();
UpdateTrackPosition();
if (app_->playlist_manager()->active()) app_->playlist_manager()->active()->set_nowplaying(false);
SendNowPlaying();
}

View File

@ -595,9 +595,9 @@ int Playlist::previous_row(const bool ignore_repeat_track) const {
void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const bool is_stopping) {
QModelIndex old_current_item_index = current_item_index_;
QModelIndex new_current_item_index = QPersistentModelIndex(index(i, 0, QModelIndex()));
ClearStreamMetadata();
nowplaying_ = false;
if (new_current_item_index != current_item_index_) ClearStreamMetadata();
if (next_row() != -1 && next_row() != i) {
PlaylistItemPtr next_item = item_at(next_row());
@ -607,7 +607,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
}
}
current_item_index_ = QPersistentModelIndex(index(i, 0, QModelIndex()));
current_item_index_ = new_current_item_index;
// if the given item is the first in the queue, remove it from the queue
if (current_item_index_.row() == queue_->PeekNext()) {