Fix Subsonic API path
This commit is contained in:
parent
beb3ab463f
commit
dabd6f8284
|
@ -73,7 +73,13 @@ QUrl SubsonicBaseRequest::CreateUrl(const QString &ressource_name, const QList<P
|
|||
}
|
||||
|
||||
QUrl url(server_url());
|
||||
url.setPath(QString("/rest/") + ressource_name);
|
||||
|
||||
if (url.path().right(1) == '/') {
|
||||
url.setPath(url.path() + QString("rest/") + ressource_name);
|
||||
}
|
||||
else
|
||||
url.setPath(url.path() + QString("/rest/") + ressource_name);
|
||||
|
||||
url.setQuery(url_query);
|
||||
|
||||
return url;
|
||||
|
|
|
@ -140,7 +140,12 @@ void SubsonicService::SendPing(QUrl url, const QString &username, const QString
|
|||
url_query.addQueryItem(encoded_param.first, encoded_param.second);
|
||||
}
|
||||
|
||||
url.setPath("/rest/ping.view");
|
||||
if (url.path().right(1) == '/') {
|
||||
url.setPath(url.path() + QString("rest/ping.view"));
|
||||
}
|
||||
else
|
||||
url.setPath(url.path() + QString("/rest/ping.view"));
|
||||
|
||||
url.setQuery(url_query);
|
||||
|
||||
QNetworkRequest req(url);
|
||||
|
|
|
@ -45,7 +45,13 @@ UrlHandler::LoadResult SubsonicUrlHandler::StartLoading(const QUrl &url) {
|
|||
}
|
||||
|
||||
QUrl media_url(server_url());
|
||||
media_url.setPath("/rest/stream");
|
||||
|
||||
if (media_url.path().right(1) == '/') {
|
||||
media_url.setPath(media_url.path() + QString("rest/stream"));
|
||||
}
|
||||
else
|
||||
media_url.setPath(media_url.path() + QString("/rest/stream"));
|
||||
|
||||
media_url.setQuery(url_query);
|
||||
|
||||
return LoadResult(url, LoadResult::TrackAvailable, media_url);
|
||||
|
|
Loading…
Reference in New Issue