ListenBrainzScrobbler: Ignore connection closed
This commit is contained in:
@@ -346,6 +346,12 @@ void ListenBrainzScrobbler::UpdateNowPlayingRequestFinished(QNetworkReply *reply
|
|||||||
QObject::disconnect(reply, nullptr, this, nullptr);
|
QObject::disconnect(reply, nullptr, this, nullptr);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
|
||||||
|
// ListenBrainz frequently close the connection, ignore any connection closed errors to avoid error popups
|
||||||
|
if (reply->error() == QNetworkReply::NetworkError::RemoteHostClosedError) {
|
||||||
|
JsonBaseRequest::Error(QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const JsonObjectResult json_object_result = ParseJsonObject(reply);
|
const JsonObjectResult json_object_result = ParseJsonObject(reply);
|
||||||
if (!json_object_result.success()) {
|
if (!json_object_result.success()) {
|
||||||
Error(json_object_result.error_message);
|
Error(json_object_result.error_message);
|
||||||
@@ -451,6 +457,14 @@ void ListenBrainzScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, Scrobb
|
|||||||
|
|
||||||
submitted_ = false;
|
submitted_ = false;
|
||||||
|
|
||||||
|
// ListenBrainz frequently close the connection, ignore any connection closed errors to avoid error popups
|
||||||
|
if (reply->error() == QNetworkReply::NetworkError::RemoteHostClosedError) {
|
||||||
|
JsonBaseRequest::Error(QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
|
||||||
|
cache_->ClearSent(cache_items);
|
||||||
|
submit_error_ = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const JsonObjectResult json_object_result = ParseJsonObject(reply);
|
const JsonObjectResult json_object_result = ParseJsonObject(reply);
|
||||||
if (json_object_result.success()) {
|
if (json_object_result.success()) {
|
||||||
const QJsonObject &json_object = json_object_result.json_object;
|
const QJsonObject &json_object = json_object_result.json_object;
|
||||||
|
|||||||
Reference in New Issue
Block a user