From 53fc939e353a4b10c57d26a1764414ca3bed3aa3 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 7 Feb 2024 01:34:46 +0100 Subject: [PATCH] ScrobblingAPI20: Ignore permission related error Last.fm returns permission denied error when servers are overloaded, ignore this error instead. Fixes #442 --- src/scrobbler/scrobblingapi20.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/scrobbler/scrobblingapi20.cpp b/src/scrobbler/scrobblingapi20.cpp index 7163c34d7..72a9565ff 100644 --- a/src/scrobbler/scrobblingapi20.cpp +++ b/src/scrobbler/scrobblingapi20.cpp @@ -174,13 +174,10 @@ ScrobblingAPI20::ReplyResult ScrobblingAPI20::GetJsonObject(QNetworkReply *reply reply_error_type = ReplyResult::APIError; } const ScrobbleErrorCode lastfm_error_code = static_cast(error_code); - if (reply->error() == QNetworkReply::ContentAccessDenied || - reply->error() == QNetworkReply::ContentOperationNotPermittedError || - reply->error() == QNetworkReply::AuthenticationRequiredError || + if (reply->error() == QNetworkReply::AuthenticationRequiredError || lastfm_error_code == ScrobbleErrorCode::InvalidSessionKey || lastfm_error_code == ScrobbleErrorCode::UnauthorizedToken || lastfm_error_code == ScrobbleErrorCode::LoginRequired || - lastfm_error_code == ScrobbleErrorCode::AuthenticationFailed || lastfm_error_code == ScrobbleErrorCode::APIKeySuspended ) { // Session is probably expired