diff --git a/src/tidal/tidalbaserequest.h b/src/tidal/tidalbaserequest.h index 7f2256e3c..2a92338e8 100644 --- a/src/tidal/tidalbaserequest.h +++ b/src/tidal/tidalbaserequest.h @@ -71,7 +71,6 @@ class TidalBaseRequest : public QObject { virtual void Error(const QString &error, const QVariant &debug = QVariant()) = 0; static QString ErrorsToHTML(const QStringList &errors); - QString api_url() { return QString(kApiUrl); } bool oauth() { return service_->oauth(); } QString client_id() { return service_->client_id(); } QString api_token() { return service_->api_token(); } @@ -97,9 +96,10 @@ class TidalBaseRequest : public QObject { private slots: void HandleSSLErrors(const QList &ssl_errors); - private: + protected: static const char *kApiUrl; + private: TidalService *service_; NetworkAccessManager *network_; diff --git a/src/tidal/tidalfavoriterequest.cpp b/src/tidal/tidalfavoriterequest.cpp index cc4073aac..a45a9ab47 100644 --- a/src/tidal/tidalfavoriterequest.cpp +++ b/src/tidal/tidalfavoriterequest.cpp @@ -133,7 +133,7 @@ void TidalFavoriteRequest::AddFavorites(const FavoriteType type, const SongList url_query.addQueryItem(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second)); } - QUrl url(api_url() + QString("/") + "users/" + QString::number(service_->user_id()) + "/favorites/" + FavoriteText(type)); + QUrl url(kApiUrl + QString("/") + "users/" + QString::number(service_->user_id()) + "/favorites/" + FavoriteText(type)); QNetworkRequest req(url); #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy); @@ -239,7 +239,7 @@ void TidalFavoriteRequest::RemoveFavorites(const FavoriteType type, const QStrin url_query.addQueryItem(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second)); } - QUrl url(api_url() + QString("/") + "users/" + QString::number(service_->user_id()) + "/favorites/" + FavoriteText(type) + QString("/") + id); + QUrl url(kApiUrl + QString("/") + "users/" + QString::number(service_->user_id()) + "/favorites/" + FavoriteText(type) + QString("/") + id); url.setQuery(url_query); QNetworkRequest req(url); #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)