diff --git a/gui/covers.cpp b/gui/covers.cpp index 9030a50fb..2c1864f68 100644 --- a/gui/covers.cpp +++ b/gui/covers.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -420,11 +421,17 @@ void Covers::clearDummyCache(const Song &song) Covers::Image Covers::getImage(const Song &song) { QString dirName; + QString songFile=song.file; bool haveAbsPath=song.file.startsWith('/'); - if (haveAbsPath || !Settings::self()->mpdDir().isEmpty()) { - dirName=song.file.endsWith('/') ? (haveAbsPath ? QString() : Settings::self()->mpdDir())+song.file - : MPDParseUtils::getDir((haveAbsPath ? QString() : Settings::self()->mpdDir())+song.file); + if (song.isCantataStream()) { + QUrl u(songFile); + songFile=u.hasQueryItem("file") ? u.queryItemValue("file") : QString(); + } + if (!songFile.isEmpty() && + (haveAbsPath || !Settings::self()->mpdDir().isEmpty())) { + dirName=songFile.endsWith('/') ? (haveAbsPath ? QString() : Settings::self()->mpdDir())+songFile + : MPDParseUtils::getDir((haveAbsPath ? QString() : Settings::self()->mpdDir())+songFile); initCoverNames(); foreach (const QString &fileName, coverFileNames) { if (QFile::exists(dirName+fileName)) { diff --git a/http/httpserver.cpp b/http/httpserver.cpp index 3330fed9d..6eb106b57 100644 --- a/http/httpserver.cpp +++ b/http/httpserver.cpp @@ -138,6 +138,9 @@ QByteArray HttpServer::encodeUrl(const Song &s) const if (s.track) { url.addQueryItem("track", QString::number(s.track)); } + if (!s.file.isEmpty()) { + url.addQueryItem("file", s.file); + } url.addQueryItem("cantata", "song"); return url.toEncoded(); }