From 53cc47a8b1e5ee84398e6adbc3f1e5e9974424d5 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 25 Jun 2021 16:04:19 +0200 Subject: [PATCH] Use localhost directly as redirect for scrobbling API 2.0 --- src/scrobbler/scrobblingapi20.cpp | 10 +--------- src/scrobbler/scrobblingapi20.h | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/scrobbler/scrobblingapi20.cpp b/src/scrobbler/scrobblingapi20.cpp index 67da9e539..82fd13a07 100644 --- a/src/scrobbler/scrobblingapi20.cpp +++ b/src/scrobbler/scrobblingapi20.cpp @@ -62,7 +62,6 @@ const char *ScrobblingAPI20::kApiKey = "211990b4c96782c05d1536e7219eb56e"; const char *ScrobblingAPI20::kSecret = "80fd738f49596e9709b1bf9319c444a8"; -const char *ScrobblingAPI20::kRedirectUrl = "https://oauth.strawberrymusicplayer.org"; const int ScrobblingAPI20::kScrobblesPerRequest = 50; ScrobblingAPI20::ScrobblingAPI20(const QString &name, const QString &settings_group, const QString &auth_url, const QString &api_url, const bool batch, Application *app, QObject *parent) : @@ -159,16 +158,9 @@ void ScrobblingAPI20::Authenticate(const bool https) { QObject::connect(server_, &LocalRedirectServer::Finished, this, &ScrobblingAPI20::RedirectArrived); } - QUrlQuery redirect_url_query; - const QString port = QString::number(server_->url().port()); - redirect_url_query.addQueryItem("port", port); - if (https) redirect_url_query.addQueryItem("https", QString("1")); - QUrl redirect_url(kRedirectUrl); - redirect_url.setQuery(redirect_url_query); - QUrlQuery url_query; url_query.addQueryItem("api_key", kApiKey); - url_query.addQueryItem("cb", redirect_url.toString()); + url_query.addQueryItem("cb", server_->url().toString()); QUrl url(auth_url_); url.setQuery(url_query); diff --git a/src/scrobbler/scrobblingapi20.h b/src/scrobbler/scrobblingapi20.h index f5d11ad3b..819577a14 100644 --- a/src/scrobbler/scrobblingapi20.h +++ b/src/scrobbler/scrobblingapi20.h @@ -49,7 +49,6 @@ class ScrobblingAPI20 : public ScrobblerService { ~ScrobblingAPI20() override; static const char *kApiKey; - static const char *kRedirectUrl; void ReloadSettings() override; void LoadSession();