Fix TryLoadPixmap and ShowCover

This commit is contained in:
Jonas Kvinge
2019-07-09 01:14:58 +02:00
parent f94a3095fd
commit aa8679dff5
3 changed files with 8 additions and 8 deletions

View File

@@ -251,18 +251,18 @@ QUrl AlbumCoverChoiceController::UnsetCover(Song *song) {
void AlbumCoverChoiceController::ShowCover(const Song &song) {
QPixmap pixmap = AlbumCoverLoader::TryLoadPixmap(song.art_automatic(), song.art_manual(), song.url().toLocalFile());
QPixmap pixmap = AlbumCoverLoader::TryLoadPixmap(song.art_automatic(), song.art_manual(), song.url());
ShowCover(song, pixmap);
}
void AlbumCoverChoiceController::ShowCover(const Song &song, const QImage &image) {
if (song.art_manual().isLocalFile() || song.art_automatic().isLocalFile()) {
QPixmap pixmap = AlbumCoverLoader::TryLoadPixmap(song.art_automatic(), song.art_manual(), song.url().toLocalFile());
if (!image.isNull()) ShowCover(song, QPixmap::fromImage(image));
else if (!song.art_manual().isEmpty() || !song.art_automatic().isEmpty()) {
QPixmap pixmap = AlbumCoverLoader::TryLoadPixmap(song.art_automatic(), song.art_manual(), song.url());
if (!pixmap.isNull()) ShowCover(song, pixmap);
}
else if (!image.isNull()) ShowCover(song, QPixmap::fromImage(image));
}