Use const reference for AlbumCoverLoaderResult

This commit is contained in:
Jonas Kvinge
2023-04-09 22:26:17 +02:00
parent f8d2c7eba3
commit 2f17647cd3
37 changed files with 242 additions and 309 deletions

View File

@@ -1461,21 +1461,11 @@ void PlaylistView::Stopped() {
}
void PlaylistView::AlbumCoverLoaded(const Song &song, AlbumCoverLoaderResultPtr result) {
void PlaylistView::AlbumCoverLoaded(const Song &song, const AlbumCoverLoaderResult &result) {
AlbumCoverImageResultPtr album_cover;
if (result) {
album_cover = result->album_cover;
}
if ((song != Song() && song_playing_ == Song()) || result.album_cover.image == current_song_cover_art_) return;
if ((song != Song() && song_playing_ == Song()) || (!album_cover && current_song_cover_art_.isNull()) || (album_cover && album_cover->image == current_song_cover_art_)) return;
if (album_cover) {
current_song_cover_art_ = album_cover->image;
}
else {
current_song_cover_art_ = QImage();
}
current_song_cover_art_ = result.album_cover.image;
if (background_image_type_ == AppearanceSettingsPage::BackgroundImageType::Album) {
if (song.art_automatic().isEmpty() && song.art_manual().isEmpty()) {