diff --git a/src/settings/tidalsettingspage.cpp b/src/settings/tidalsettingspage.cpp index 1a1dbf9d6..d79284ae2 100644 --- a/src/settings/tidalsettingspage.cpp +++ b/src/settings/tidalsettingspage.cpp @@ -70,10 +70,6 @@ TidalSettingsPage::TidalSettingsPage(SettingsDialog *parent) ui_->streamurl->addItem("urlpostpaywall", StreamUrlMethod_UrlPostPaywall); ui_->streamurl->addItem("playbackinfopostpaywall", StreamUrlMethod_PlaybackInfoPostPaywall); - ui_->oauth->hide(); - ui_->label_client_id->hide(); - ui_->client_id->hide(); - } TidalSettingsPage::~TidalSettingsPage() { delete ui_; } @@ -84,8 +80,7 @@ void TidalSettingsPage::Load() { s.beginGroup(kSettingsGroup); ui_->enable->setChecked(s.value("enabled", false).toBool()); - //ui_->oauth->setChecked(s.value("oauth", false).toBool()); - ui_->oauth->setChecked(false); + ui_->oauth->setChecked(s.value("oauth", false).toBool()); ui_->client_id->setText(s.value("client_id").toString()); ui_->api_token->setText(s.value("api_token").toString()); @@ -145,6 +140,10 @@ void TidalSettingsPage::Save() { void TidalSettingsPage::LoginClicked() { if (ui_->oauth->isChecked()) { + if (ui_->client_id->text().isEmpty()) { + QMessageBox::critical(this, tr("Configuration incomplete"), tr("Missing Tidal client ID.")); + return; + } emit Login(); } else { diff --git a/src/tidal/tidalservice.cpp b/src/tidal/tidalservice.cpp index a81290815..454421880 100644 --- a/src/tidal/tidalservice.cpp +++ b/src/tidal/tidalservice.cpp @@ -62,7 +62,6 @@ using std::shared_ptr; const Song::Source TidalService::kSource = Song::Source_Tidal; -const char *TidalService::kClientIdB64 = "dTVxUE5OWUliRDBTMG8zNk1yQWlGWjU2SzZxTUNyQ21ZUHpadVRuVg=="; const char *TidalService::kApiTokenB64 = "UDVYYmVvNUxGdkVTZUR5Ng=="; const char *TidalService::kOAuthUrl = "https://login.tidal.com/authorize"; const char *TidalService::kOAuthAccessTokenUrl = "https://login.tidal.com/oauth2/token"; @@ -198,10 +197,8 @@ void TidalService::ReloadSettings() { QSettings s; s.beginGroup(TidalSettingsPage::kSettingsGroup); - //oauth_ = s.value("oauth", false).toBool(); - oauth_ = false; + oauth_ = s.value("oauth", false).toBool(); client_id_ = s.value("client_id").toString(); - if (client_id_.isEmpty()) client_id_ = QString::fromUtf8(QByteArray::fromBase64(kClientIdB64)); api_token_ = s.value("api_token").toString(); if (api_token_.isEmpty()) api_token_ = QString::fromUtf8(QByteArray::fromBase64(kApiTokenB64)); diff --git a/src/tidal/tidalservice.h b/src/tidal/tidalservice.h index 2632d557f..ad9c25e02 100644 --- a/src/tidal/tidalservice.h +++ b/src/tidal/tidalservice.h @@ -162,7 +162,6 @@ class TidalService : public InternetService { void SendSearch(); QString LoginError(QString error, QVariant debug = QVariant()); - static const char *kClientIdB64; static const char *kApiTokenB64; static const char *kOAuthUrl; static const char *kOAuthAccessTokenUrl;