Formatting
This commit is contained in:
@@ -118,7 +118,7 @@ QNetworkReply *LastFMImport::CreateRequest(const ParamList &request_params) {
|
||||
|
||||
QNetworkReply *reply = CreateGetRequest(QUrl(QLatin1String(LastFMScrobbler::kApiUrl)), params);
|
||||
|
||||
//qLog(Debug) << "Sending request" << url_query.toString(QUrl::FullyDecoded);
|
||||
// qLog(Debug) << "Sending request" << url_query.toString(QUrl::FullyDecoded);
|
||||
|
||||
return reply;
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ void LastFMScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, ScrobblerCac
|
||||
const QJsonValue value_album = json_track["album"_L1];
|
||||
const QJsonValue value_song = json_track["track"_L1];
|
||||
const QJsonValue value_ignoredmessage = json_track["ignoredMessage"_L1];
|
||||
//const quint64 timestamp = json_track[u"timestamp"_s].toVariant().toULongLong();
|
||||
// const quint64 timestamp = json_track[u"timestamp"_s].toVariant().toULongLong();
|
||||
|
||||
if (!value_artist.isObject() || !value_album.isObject() || !value_song.isObject() || !value_ignoredmessage.isObject()) {
|
||||
Error(u"Json scrobbles scrobble values are not objects."_s, json_track);
|
||||
@@ -664,8 +664,8 @@ void LastFMScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, ScrobblerCac
|
||||
continue;
|
||||
}
|
||||
|
||||
//const QString artist = obj_artist["#text"].toString();
|
||||
//const QString album = obj_album["#text"].toString();
|
||||
// const QString artist = obj_artist["#text"].toString();
|
||||
// const QString album = obj_album["#text"].toString();
|
||||
const QString song = object_song["#text"_L1].toString();
|
||||
const bool ignoredmessage = object_ignoredmessage["code"_L1].toVariant().toBool();
|
||||
const QString ignoredmessage_text = object_ignoredmessage["#text"_L1].toString();
|
||||
@@ -800,8 +800,8 @@ void LastFMScrobbler::SingleScrobbleRequestFinished(QNetworkReply *reply, Scrobb
|
||||
return;
|
||||
}
|
||||
|
||||
//QString artist = json_obj_artist["#text"].toString();
|
||||
//QString album = json_obj_album["#text"].toString();
|
||||
// QString artist = json_obj_artist["#text"].toString();
|
||||
// QString album = json_obj_album["#text"].toString();
|
||||
const QString song = json_object_song["#text"_L1].toString();
|
||||
|
||||
const int accepted = object_attr["accepted"_L1].toVariant().toInt();
|
||||
@@ -839,7 +839,7 @@ void LastFMScrobbler::Love() {
|
||||
}
|
||||
|
||||
QNetworkReply *reply = CreateRequest(params);
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply] { LoveRequestFinished(reply); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]{ LoveRequestFinished(reply); });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Strawberry Music Player
|
||||
* Copyright 2023, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
* Strawberry Music Player
|
||||
* Copyright 2023, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/song.h"
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Strawberry Music Player
|
||||
* Copyright 2023, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
* Strawberry Music Player
|
||||
* Copyright 2023, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCROBBLEMETADATA_H
|
||||
#define SCROBBLEMETADATA_H
|
||||
|
||||
@@ -118,15 +118,13 @@ void ScrobblerCache::ReadCache() {
|
||||
continue;
|
||||
}
|
||||
QJsonObject json_obj_track = value.toObject();
|
||||
if (
|
||||
!json_obj_track.contains("timestamp"_L1) ||
|
||||
if (!json_obj_track.contains("timestamp"_L1) ||
|
||||
!json_obj_track.contains("artist"_L1) ||
|
||||
!json_obj_track.contains("album"_L1) ||
|
||||
!json_obj_track.contains("title"_L1) ||
|
||||
!json_obj_track.contains("track"_L1) ||
|
||||
!json_obj_track.contains("albumartist"_L1) ||
|
||||
!json_obj_track.contains("length_nanosec"_L1)
|
||||
) {
|
||||
!json_obj_track.contains("length_nanosec"_L1)) {
|
||||
qLog(Error) << "Scrobbler cache JSON tracks array value is missing data.";
|
||||
qLog(Debug) << value;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user