1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-19 04:00:40 +01:00

Use protected kApiUrl

This commit is contained in:
Jonas Kvinge 2021-06-28 00:21:33 +02:00
parent bb134ee7ac
commit fdc9a71f9e
2 changed files with 4 additions and 4 deletions

View File

@ -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<QSslError> &ssl_errors);
private:
protected:
static const char *kApiUrl;
private:
TidalService *service_;
NetworkAccessManager *network_;

View File

@ -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)