Fix decoding URLs when playing local files via in-built HTTP server.

Closes #1664
This commit is contained in:
Craig Drummond
2021-01-14 19:33:40 +00:00
parent e4e529fb9e
commit 848dc5a6b3
2 changed files with 19 additions and 18 deletions

View File

@@ -256,22 +256,22 @@ Song HttpServer::decodeUrl(const QUrl &url) const
if (q.hasQueryItem("cantata") && q.queryItemValue("cantata")=="song") {
if (q.hasQueryItem("album")) {
s.album=q.queryItemValue("album");
s.album=q.queryItemValue("album", QUrl::FullyDecoded);
}
if (q.hasQueryItem("artist")) {
s.artist=q.queryItemValue("artist");
s.artist=q.queryItemValue("artist", QUrl::FullyDecoded);
}
if (q.hasQueryItem("albumartist")) {
s.albumartist=q.queryItemValue("albumartist");
s.albumartist=q.queryItemValue("albumartist", QUrl::FullyDecoded);
}
if (q.hasQueryItem("composer")) {
s.setComposer(q.queryItemValue("composer"));
s.setComposer(q.queryItemValue("composer", QUrl::FullyDecoded));
}
if (q.hasQueryItem("title")) {
s.title=q.queryItemValue("title");
s.title=q.queryItemValue("title", QUrl::FullyDecoded);
}
if (q.hasQueryItem("genre")) {
s.addGenre(q.queryItemValue("genre"));
s.addGenre(q.queryItemValue("genre", QUrl::FullyDecoded));
}
if (q.hasQueryItem("disc")) {
s.disc=q.queryItemValue("disc").toInt();
@@ -289,10 +289,10 @@ Song HttpServer::decodeUrl(const QUrl &url) const
s.id=q.queryItemValue("id").toInt();
}
if (q.hasQueryItem("onlineservice")) {
s.setIsFromOnlineService(q.queryItemValue("onlineservice"));
s.setIsFromOnlineService(q.queryItemValue("onlineservice", QUrl::FullyDecoded));
}
#ifdef Q_OS_WIN
s.file=fixWindowsPath(q.queryItemValue("file"));
s.file=fixWindowsPath(q.queryItemValue("file", QUrl::FullyDecoded));
#else
s.file=url.path();
#endif