diff --git a/src/scrobbler/scrobblingapi20.cpp b/src/scrobbler/scrobblingapi20.cpp index 8832c2e7f..4e8be1245 100644 --- a/src/scrobbler/scrobblingapi20.cpp +++ b/src/scrobbler/scrobblingapi20.cpp @@ -403,7 +403,23 @@ void ScrobblingAPI20::UpdateNowPlayingRequestFinished(QNetworkReply *reply) { return; } - // TODO + QJsonObject json_obj = ExtractJsonObj(data); + if (json_obj.isEmpty()) { + return; + } + + if (json_obj.contains("error") && json_obj.contains("message")) { + int error_code = json_obj["error"].toInt(); + QString error_message = json_obj["message"].toString(); + QString error_reason = QString("%1 (%2)").arg(error_message).arg(error_code); + Error(error_reason); + return; + } + + if (!json_obj.contains("nowplaying")) { + Error("Json reply from server is missing nowplaying.", json_obj); + return; + } }