LocalRedirectServer: Remove https option and gnutls dependency

This commit is contained in:
Jonas Kvinge
2023-07-18 19:20:51 +02:00
parent dc65753a0b
commit 56180ca419
17 changed files with 18 additions and 266 deletions

View File

@@ -160,11 +160,10 @@ void ListenBrainzScrobbler::Logout() {
}
void ListenBrainzScrobbler::Authenticate(const bool https) {
void ListenBrainzScrobbler::Authenticate() {
if (!server_) {
server_ = new LocalRedirectServer(this);
server_->set_https(https);
if (!server_->Listen()) {
AuthError(server_->error());
delete server_;

View File

@@ -62,7 +62,7 @@ class ListenBrainzScrobbler : public ScrobblerService {
void Submitted() override { submitted_ = true; }
QString user_token() const { return user_token_; }
void Authenticate(const bool https = false);
void Authenticate();
void Logout();
void ShowConfig();
void Submit() override;

View File

@@ -74,7 +74,6 @@ ScrobblingAPI20::ScrobblingAPI20(const QString &name, const QString &settings_gr
cache_(new ScrobblerCache(cache_file, this)),
server_(nullptr),
enabled_(false),
https_(false),
prefer_albumartist_(false),
subscriber_(false),
submitted_(false),
@@ -113,7 +112,6 @@ void ScrobblingAPI20::ReloadSettings() {
s.beginGroup(settings_group_);
enabled_ = s.value("enabled", false).toBool();
https_ = s.value("https", false).toBool();
s.endGroup();
s.beginGroup(ScrobblerSettingsPage::kSettingsGroup);
@@ -193,11 +191,10 @@ ScrobblingAPI20::ReplyResult ScrobblingAPI20::GetJsonObject(QNetworkReply *reply
}
void ScrobblingAPI20::Authenticate(const bool https) {
void ScrobblingAPI20::Authenticate() {
if (!server_) {
server_ = new LocalRedirectServer(this);
server_->set_https(https);
if (!server_->Listen()) {
AuthError(server_->error());
delete server_;
@@ -260,7 +257,7 @@ void ScrobblingAPI20::RedirectArrived() {
}
}
else {
AuthError(tr("Received invalid reply from web browser. Try the HTTPS option, or use another browser like Chromium or Chrome."));
AuthError(tr("Received invalid reply from web browser. Try another browser."));
}
}
else {

View File

@@ -54,14 +54,13 @@ class ScrobblingAPI20 : public ScrobblerService {
void LoadSession();
bool IsEnabled() const override { return enabled_; }
bool IsUseHTTPS() const { return https_; }
bool IsAuthenticated() const override { return !username_.isEmpty() && !session_key_.isEmpty(); }
bool IsSubscriber() const { return subscriber_; }
bool IsSubmitted() const override { return submitted_; }
void Submitted() override { submitted_ = true; }
QString username() const { return username_; }
void Authenticate(const bool https = false);
void Authenticate();
void Logout();
void UpdateNowPlaying(const Song &song) override;
void ClearPlaying() override;
@@ -148,7 +147,6 @@ class ScrobblingAPI20 : public ScrobblerService {
LocalRedirectServer *server_;
bool enabled_;
bool https_;
bool prefer_albumartist_;
bool subscriber_;