Clementine-audio-player-Mac.../src/internet/subsonicurlhandler.cpp

17 lines
525 B
C++
Raw Normal View History

2012-01-10 17:52:54 +01:00
#include "subsonicservice.h"
#include "subsonicurlhandler.h"
SubsonicUrlHandler::SubsonicUrlHandler(SubsonicService* service, QObject* parent)
: UrlHandler(parent),
service_(service) {
}
UrlHandler::LoadResult SubsonicUrlHandler::StartLoading(const QUrl& url) {
if (service_->login_state() != SubsonicService::LoginState_Loggedin)
return LoadResult();
2013-01-09 23:20:55 +01:00
QUrl newurl = service_->BuildRequestUrl("stream");
newurl.addQueryItem("id", url.host());
2012-01-10 17:52:54 +01:00
return LoadResult(url, LoadResult::TrackAvailable, newurl);
}