1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-14 09:44:51 +01:00

Use localhost directly as redirect for scrobbling API 2.0

This commit is contained in:
Jonas Kvinge 2021-06-25 16:04:19 +02:00
parent 55f8294a38
commit 53cc47a8b1
2 changed files with 1 additions and 10 deletions

View File

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

View File

@ -49,7 +49,6 @@ class ScrobblingAPI20 : public ScrobblerService {
~ScrobblingAPI20() override;
static const char *kApiKey;
static const char *kRedirectUrl;
void ReloadSettings() override;
void LoadSession();