Make scrobbler show error dialog for all errors when option is on
This commit is contained in:
@@ -48,7 +48,7 @@ AudioScrobbler::AudioScrobbler(Application *app, QObject *parent) :
|
||||
love_button_(false),
|
||||
submit_delay_(0),
|
||||
prefer_albumartist_(false),
|
||||
show_auth_error_(false)
|
||||
show_error_dialog_(false)
|
||||
{
|
||||
|
||||
scrobbler_services_->AddService(new LastFMScrobbler(app_, scrobbler_services_));
|
||||
@@ -75,7 +75,7 @@ void AudioScrobbler::ReloadSettings() {
|
||||
love_button_ = s.value("love_button", false).toBool();
|
||||
submit_delay_ = s.value("submit", 0).toInt();
|
||||
prefer_albumartist_ = s.value("albumartist", false).toBool();
|
||||
show_auth_error_ = s.value("show_auth_error", true).toBool();
|
||||
show_error_dialog_ = s.value("show_error_dialog", true).toBool();
|
||||
s.endGroup();
|
||||
|
||||
emit ScrobblingEnabledChanged(enabled_);
|
||||
|
||||
@@ -46,7 +46,7 @@ class AudioScrobbler : public QObject {
|
||||
bool LoveButton() const { return love_button_; }
|
||||
int SubmitDelay() const { return submit_delay_; }
|
||||
bool PreferAlbumArtist() const { return prefer_albumartist_; }
|
||||
bool ShowAuthError() const { return show_auth_error_; }
|
||||
bool ShowErrorDialog() const { return show_error_dialog_; }
|
||||
|
||||
void UpdateNowPlaying(const Song &song);
|
||||
void ClearPlaying();
|
||||
@@ -86,7 +86,7 @@ class AudioScrobbler : public QObject {
|
||||
bool love_button_;
|
||||
int submit_delay_;
|
||||
bool prefer_albumartist_;
|
||||
bool show_auth_error_;
|
||||
bool show_error_dialog_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -525,7 +525,7 @@ void ScrobblingAPI20::Scrobble(const Song &song) {
|
||||
if (app_->scrobbler()->IsOffline()) return;
|
||||
|
||||
if (!IsAuthenticated()) {
|
||||
if (app_->scrobbler()->ShowAuthError()) { emit ErrorMessage(tr("Scrobbler %1 is not authenticated!").arg(name_)); }
|
||||
if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 is not authenticated!").arg(name_)); }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -987,6 +987,8 @@ void ScrobblingAPI20::Error(const QString &error, const QVariant &debug) {
|
||||
qLog(Error) << name_ << error;
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 error: %2").arg(name_).arg(error)); }
|
||||
|
||||
}
|
||||
|
||||
QString ScrobblingAPI20::ErrorString(const ScrobbleErrorCode error) const {
|
||||
|
||||
Reference in New Issue
Block a user