Fix save album cover to file

Fixes #412
This commit is contained in:
Jonas Kvinge
2020-04-26 18:48:07 +02:00
parent 15080972f3
commit d93ec82e4f

View File

@@ -63,6 +63,7 @@
#include "core/application.h" #include "core/application.h"
#include "core/iconloader.h" #include "core/iconloader.h"
#include "core/utilities.h" #include "core/utilities.h"
#include "core/logging.h"
#include "widgets/forcescrollperpixel.h" #include "widgets/forcescrollperpixel.h"
#include "widgets/qsearchfield.h" #include "widgets/qsearchfield.h"
#include "collection/sqlrow.h" #include "collection/sqlrow.h"
@@ -670,13 +671,13 @@ void AlbumCoverManager::SaveCoverToFile() {
image = no_cover_image_; image = no_cover_image_;
} }
else { else {
if (!song.art_manual().isEmpty() && !song.art_manual().isLocalFile() && QFile::exists(song.art_manual().toLocalFile())) { if (!song.art_manual().isEmpty() && song.art_manual().isLocalFile() && QFile::exists(song.art_manual().toLocalFile())) {
image = QImage(song.art_manual().toLocalFile()); image = QImage(song.art_manual().toLocalFile());
} }
else if (!song.art_manual().isEmpty() && !song.art_manual().path().isEmpty() && song.art_manual().scheme().isEmpty() && QFile::exists(song.art_manual().path())) { else if (!song.art_manual().isEmpty() && !song.art_manual().path().isEmpty() && song.art_manual().scheme().isEmpty() && QFile::exists(song.art_manual().path())) {
image = QImage(song.art_manual().path()); image = QImage(song.art_manual().path());
} }
else if (!song.art_automatic().isEmpty() && !song.art_automatic().isLocalFile() && QFile::exists(song.art_automatic().toLocalFile())) { else if (!song.art_automatic().isEmpty() && song.art_automatic().isLocalFile() && QFile::exists(song.art_automatic().toLocalFile())) {
image = QImage(song.art_automatic().toLocalFile()); image = QImage(song.art_automatic().toLocalFile());
} }
else if (!song.art_automatic().isEmpty() && !song.art_automatic().path().isEmpty() && song.art_automatic().scheme().isEmpty() && QFile::exists(song.art_automatic().path())) { else if (!song.art_automatic().isEmpty() && !song.art_automatic().path().isEmpty() && song.art_automatic().scheme().isEmpty() && QFile::exists(song.art_automatic().path())) {