void ArtistView::artistImageUpdated(const Song &song, const QImage &i, const QString &f) { if (song.isArtistImageRequest() && song.albumartist==currentSong.artist) { pic=createPicTag(i, f); setBio(); } }
void ArtistView::update(const Song &s, bool force) { if (s.isEmpty() || s.artist.isEmpty()) { currentSong=s; engine->cancel(); clear(); abort(); return; } Song song=s; song.artist=song.basicArtist(); bool artistChanged=song.artist!=currentSong.artist; if (artistChanged) { artistAlbums.clear(); abort(); } if (!isVisible()) { if (artistChanged) { needToUpdate=true; } currentSong=song; return; } if (artistChanged || force) { currentSong=song; clear(); pic.clear(); biography.clear(); albums.clear(); similarArtists=QString(); if (!currentSong.isEmpty()) { setHeader(currentSong.artist); Song s; s.setArtistImageRequest(); s.albumartist=currentSong.artist; if (!currentSong.isVariousArtists()) { s.file=currentSong.file; } Covers::Image img=Covers::self()->requestImage(s, true); if (!img.img.isNull()) { pic=createPicTag(img.img, img.fileName); } loadBio(); } } }
void OnlineView::update(const Song &song, bool force) { if (force || song!=currentSong) { currentSong=song; if (!isVisible()) { needToUpdate=true; return; } setHeader(song.describe(true)); Covers::Image cImg=Covers::self()->requestImage(song, true); if (!cImg.img.isNull()) { setHtml(createPicTag(cImg.img, cImg.fileName)); } else { setHtml(QString()); } } }