From ad469531ff25728cd9aab03f9b6deb8f29fd778d Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 13 May 2022 23:36:38 +0200 Subject: [PATCH] SPFParser: Use percent-encoding for image too --- src/playlistparsers/xspfparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlistparsers/xspfparser.cpp b/src/playlistparsers/xspfparser.cpp index 6a596de04..a587dcf63 100644 --- a/src/playlistparsers/xspfparser.cpp +++ b/src/playlistparsers/xspfparser.cpp @@ -87,7 +87,7 @@ Song XSPFParser::ParseTrack(QXmlStreamReader *reader, const QDir &dir, const boo album = reader->readElementText(); } else if (name == "image") { - art = reader->readElementText(); + art = QUrl::fromPercentEncoding(reader->readElementText().toUtf8()); } else if (name == "duration") { // in milliseconds. const QString duration = reader->readElementText(); @@ -180,7 +180,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir, if (cover_url.scheme().isEmpty()) { cover_url.setScheme("file"); } - QString cover_filename = URLOrFilename(cover_url, dir, path_type).toUtf8(); + QString cover_filename = QUrl::toPercentEncoding(URLOrFilename(cover_url, dir, path_type), "/ "); writer.writeTextElement("image", cover_filename); } }