Fix playing of FLAC files external to MPD database via Cantata's simple HTTP server.

This commit is contained in:
craig.p.drummond
2013-01-02 19:50:58 +00:00
committed by craig.p.drummond
parent e5d48bf7c1
commit 8c1cbee767
4 changed files with 104 additions and 18 deletions

View File

@@ -140,9 +140,6 @@ 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();
}
@@ -151,6 +148,7 @@ QByteArray HttpServer::encodeUrl(const QString &file) const
{
Song s=Tags::read(file);
s.fillEmptyFields();
s.file=file;
return encodeUrl(s);
}
@@ -187,11 +185,7 @@ Song HttpServer::decodeUrl(const QString &url) const
if (u.hasQueryItem("track")) {
s.track=u.queryItemValue("track").toInt();
}
if (u.hasQueryItem("file")) {
s.file=u.queryItemValue("file");
} else {
s.file=u.path();
}
s.file=u.path();
}
return s;