Use QJsonValueRef
This commit is contained in:
@@ -221,10 +221,10 @@ void DeezerCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id)
|
||||
|
||||
QMap<QUrl, CoverProviderSearchResult> results;
|
||||
int i = 0;
|
||||
for (const QJsonValue json_value : array_data) {
|
||||
for (const QJsonValueRef json_value : array_data) {
|
||||
|
||||
if (!json_value.isObject()) {
|
||||
Error("Invalid Json reply, data array value is not a object.", json_value);
|
||||
Error("Invalid Json reply, data array value is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject json_obj = json_value.toObject();
|
||||
|
||||
@@ -273,10 +273,10 @@ void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id)
|
||||
array_results = value_results.toArray();
|
||||
}
|
||||
|
||||
for (const QJsonValue value_result : array_results) {
|
||||
for (const QJsonValueRef value_result : array_results) {
|
||||
|
||||
if (!value_result.isObject()) {
|
||||
Error("Invalid Json reply, results value is not a object.", value_result);
|
||||
Error("Invalid Json reply, results value is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_result = value_result.toObject();
|
||||
@@ -380,9 +380,9 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const int se
|
||||
QJsonArray array_artists = value_artists.toArray();
|
||||
int i = 0;
|
||||
QString artist;
|
||||
for (const QJsonValue value_artist : array_artists) {
|
||||
for (const QJsonValueRef value_artist : array_artists) {
|
||||
if (!value_artist.isObject()) {
|
||||
Error("Invalid Json reply, atists array value is not a object.", value_artist);
|
||||
Error("Invalid Json reply, atists array value is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_artist = value_artist.toObject();
|
||||
@@ -421,10 +421,10 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const int se
|
||||
return;
|
||||
}
|
||||
|
||||
for (const QJsonValue value_image : array_images) {
|
||||
for (const QJsonValueRef value_image : array_images) {
|
||||
|
||||
if (!value_image.isObject()) {
|
||||
Error("Invalid Json reply, images array value is not an object.", value_image);
|
||||
Error("Invalid Json reply, images array value is not an object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_image = value_image.toObject();
|
||||
|
||||
@@ -230,10 +230,10 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
|
||||
}
|
||||
QJsonArray array_type = value_type.toArray();
|
||||
|
||||
for (const QJsonValue value : array_type) {
|
||||
for (const QJsonValueRef value : array_type) {
|
||||
|
||||
if (!value.isObject()) {
|
||||
Error("Invalid Json reply, value in albummatches/trackmatches array is not a object.", value);
|
||||
Error("Invalid Json reply, value in albummatches/trackmatches array is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj = value.toObject();
|
||||
@@ -255,9 +255,9 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
|
||||
QJsonArray array_image = json_image.toArray();
|
||||
QUrl url;
|
||||
LastFmImageSize size(LastFmImageSize::Unknown);
|
||||
for (const QJsonValue value_image : array_image) {
|
||||
for (const QJsonValueRef value_image : array_image) {
|
||||
if (!value_image.isObject()) {
|
||||
Error("Invalid Json reply, album image value is not an object.", value_image);
|
||||
Error("Invalid Json reply, album image value is not an object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_image = value_image.toObject();
|
||||
|
||||
@@ -167,10 +167,10 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
|
||||
return;
|
||||
}
|
||||
|
||||
for (const QJsonValue value_release : array_releases) {
|
||||
for (const QJsonValueRef value_release : array_releases) {
|
||||
|
||||
if (!value_release.isObject()) {
|
||||
Error("Invalid Json reply, releases array value is not an object.", value_release);
|
||||
Error("Invalid Json reply, releases array value is not an object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_release = value_release.toObject();
|
||||
@@ -187,9 +187,9 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
|
||||
QJsonArray array_artists = json_artists.toArray();
|
||||
int i = 0;
|
||||
QString artist;
|
||||
for (const QJsonValue value_artist : array_artists) {
|
||||
for (const QJsonValueRef value_artist : array_artists) {
|
||||
if (!value_artist.isObject()) {
|
||||
Error("Invalid Json reply, artist is not a object.", value_artist);
|
||||
Error("Invalid Json reply, artist is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_artist = value_artist.toObject();
|
||||
|
||||
@@ -217,10 +217,10 @@ void QobuzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
|
||||
}
|
||||
QJsonArray array_items = value_items.toArray();
|
||||
|
||||
for (const QJsonValue value : array_items) {
|
||||
for (const QJsonValueRef value : array_items) {
|
||||
|
||||
if (!value.isObject()) {
|
||||
Error("Invalid Json reply, value in items is not a object.", value);
|
||||
Error("Invalid Json reply, value in items is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject item_obj = value.toObject();
|
||||
|
||||
@@ -495,7 +495,7 @@ void SpotifyCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
||||
}
|
||||
|
||||
CoverProviderSearchResults results;
|
||||
for (const QJsonValue value_item : array_items) {
|
||||
for (const QJsonValueRef value_item : array_items) {
|
||||
|
||||
if (!value_item.isObject()) {
|
||||
continue;
|
||||
@@ -515,14 +515,14 @@ void SpotifyCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
||||
QString album = obj_album["name"].toString();
|
||||
|
||||
QStringList artists;
|
||||
for (const QJsonValue value_artist : array_artists) {
|
||||
for (const QJsonValueRef value_artist : array_artists) {
|
||||
if (!value_artist.isObject()) continue;
|
||||
QJsonObject obj_artist = value_artist.toObject();
|
||||
if (!obj_artist.contains("name")) continue;
|
||||
artists << obj_artist["name"].toString();
|
||||
}
|
||||
|
||||
for (const QJsonValue value_image : array_images) {
|
||||
for (const QJsonValueRef value_image : array_images) {
|
||||
if (!value_image.isObject()) continue;
|
||||
QJsonObject obj_image = value_image.toObject();
|
||||
if (!obj_image.contains("url") || !obj_image.contains("width") || !obj_image.contains("height")) continue;
|
||||
|
||||
@@ -212,10 +212,10 @@ void TidalCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
|
||||
|
||||
CoverProviderSearchResults results;
|
||||
int i = 0;
|
||||
for (const QJsonValue value_item : array_items) {
|
||||
for (const QJsonValueRef value_item : array_items) {
|
||||
|
||||
if (!value_item.isObject()) {
|
||||
Error("Invalid Json reply, items array item is not a object.", value_item);
|
||||
Error("Invalid Json reply, items array item is not a object.");
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj_item = value_item.toObject();
|
||||
|
||||
Reference in New Issue
Block a user