Make sure same cover isn't loaded twice

This commit is contained in:
Jonas Kvinge
2020-09-29 17:51:31 +02:00
parent e390f3a399
commit 4614cb5ec1

View File

@@ -188,6 +188,9 @@ void PlayingWidget::SetVisible(bool visible) {
timeline_show_hide_->toggleDirection(); timeline_show_hide_->toggleDirection();
return; return;
} }
else {
timeline_show_hide_->stop();
}
} }
if (visible != visible_) { if (visible != visible_) {
@@ -268,6 +271,7 @@ void PlayingWidget::Stopped() {
active_ = false; active_ = false;
song_playing_ = Song(); song_playing_ = Song();
song_ = Song(); song_ = Song();
image_original_ = QImage();
SetVisible(false); SetVisible(false);
} }
@@ -290,7 +294,7 @@ void PlayingWidget::SongChanged(const Song &song) {
void PlayingWidget::AlbumCoverLoaded(const Song &song, const QImage &image) { void PlayingWidget::AlbumCoverLoaded(const Song &song, const QImage &image) {
if (!playing_ || song != song_playing_ || (timeline_fade_->state() == QTimeLine::Running && image == image_original_)) return; if (!playing_ || song != song_playing_ || image == image_original_) return;
active_ = true; active_ = true;
downloading_covers_ = false; downloading_covers_ = false;