Rewrite album cover loader
This commit is contained in:
@@ -172,13 +172,10 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
writer.writeTextElement("trackNum", QString::number(song.track()));
|
||||
}
|
||||
|
||||
QUrl cover_url = song.art_manual().isEmpty() || song.art_manual().path().isEmpty() ? song.art_automatic() : song.art_manual();
|
||||
const QUrl cover_url = song.art_manual().isEmpty() || !song.art_manual().isValid() ? song.art_automatic() : song.art_manual();
|
||||
// Ignore images that are in our resource bundle.
|
||||
if (!cover_url.isEmpty() && !cover_url.path().isEmpty() && cover_url.path() != Song::kManuallyUnsetCover && cover_url.path() != Song::kEmbeddedCover) {
|
||||
if (cover_url.scheme().isEmpty()) {
|
||||
cover_url.setScheme("file");
|
||||
}
|
||||
QString cover_filename = QUrl::toPercentEncoding(URLOrFilename(cover_url, dir, path_type), "/ ");
|
||||
if (!cover_url.isEmpty() && cover_url.isValid()) {
|
||||
const QString cover_filename = QUrl::toPercentEncoding(URLOrFilename(cover_url, dir, path_type), "/ ");
|
||||
writer.writeTextElement("image", cover_filename);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user