Follow redirects in subsonic
This commit is contained in:
parent
9c485c4d94
commit
4359f2a0ce
|
@ -46,8 +46,13 @@
|
||||||
SubsonicBaseRequest::SubsonicBaseRequest(SubsonicService *service, QObject *parent) :
|
SubsonicBaseRequest::SubsonicBaseRequest(SubsonicService *service, QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
service_(service),
|
service_(service),
|
||||||
network_(new QNetworkAccessManager)
|
network_(new QNetworkAccessManager) {
|
||||||
{}
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||||
|
network_->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SubsonicBaseRequest::~SubsonicBaseRequest() {}
|
SubsonicBaseRequest::~SubsonicBaseRequest() {}
|
||||||
|
|
||||||
|
@ -123,6 +128,7 @@ QByteArray SubsonicBaseRequest::GetReplyData(QNetworkReply *reply) {
|
||||||
Error(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
|
Error(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// See if there is Json data containing "error" - then use that instead.
|
// See if there is Json data containing "error" - then use that instead.
|
||||||
data = reply->readAll();
|
data = reply->readAll();
|
||||||
QString error;
|
QString error;
|
||||||
|
|
|
@ -65,7 +65,13 @@ SubsonicRequest::SubsonicRequest(SubsonicService *service, SubsonicUrlHandler *u
|
||||||
album_covers_requested_(0),
|
album_covers_requested_(0),
|
||||||
album_covers_received_(0),
|
album_covers_received_(0),
|
||||||
no_results_(false)
|
no_results_(false)
|
||||||
{}
|
{
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||||
|
network_->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SubsonicRequest::~SubsonicRequest() {
|
SubsonicRequest::~SubsonicRequest() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue