Remove unused variables
This commit is contained in:
parent
329dfb21b9
commit
20c1c1d4be
|
@ -142,7 +142,6 @@ QByteArray DeezerCoverProvider::GetReplyData(QNetworkReply *reply) {
|
|||
QJsonObject obj_error = value_error.toObject();
|
||||
int code = obj_error["code"].toInt();
|
||||
QString message = obj_error["message"].toString();
|
||||
QString type = obj_error["type"].toString();
|
||||
error = QString("%1 (%2)").arg(message).arg(code);
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +177,6 @@ QJsonValue DeezerCoverProvider::ExtractData(const QByteArray &data) {
|
|||
QJsonObject obj_error = value_error.toObject();
|
||||
const int code = obj_error["code"].toInt();
|
||||
QString message = obj_error["message"].toString();
|
||||
QString type = obj_error["type"].toString();
|
||||
Error(QString("%1 (%2)").arg(message).arg(code));
|
||||
return QJsonValue();
|
||||
}
|
||||
|
|
|
@ -140,7 +140,6 @@ QByteArray QobuzCoverProvider::GetReplyData(QNetworkReply *reply) {
|
|||
if (parse_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
|
||||
QJsonObject json_obj = json_doc.object();
|
||||
if (!json_obj.isEmpty() && json_obj.contains("status") && json_obj.contains("code") && json_obj.contains("message")) {
|
||||
QString status = json_obj["status"].toString();
|
||||
int code = json_obj["code"].toInt();
|
||||
QString message = json_obj["message"].toString();
|
||||
error = QString("%1 (%2)").arg(message).arg(code);
|
||||
|
|
|
@ -173,7 +173,6 @@ void GeniusLyricsProvider::RequestAccessToken(const QUrl &url, const QUrl &redir
|
|||
if (url.hasQuery() && url_query.hasQueryItem("code") && url_query.hasQueryItem("state")) {
|
||||
|
||||
QString code = url_query.queryItemValue("code");
|
||||
QString state = url_query.queryItemValue("state");
|
||||
|
||||
const ParamList params = ParamList() << Param("code", code)
|
||||
<< Param("client_id", QByteArray::fromBase64(kClientIDB64))
|
||||
|
@ -241,7 +240,7 @@ void GeniusLyricsProvider::AccessTokenRequestFinished(QNetworkReply *reply) {
|
|||
if (!json_obj.isEmpty() && json_obj.contains("error") && json_obj.contains("error_description")) {
|
||||
QString error = json_obj["error"].toString();
|
||||
QString error_description = json_obj["error_description"].toString();
|
||||
login_errors_ << QString("Authentication failure: %1 (%2)").arg(error).arg(error_description);
|
||||
login_errors_ << QString("Authentication failure: %1 (%2)").arg(error, error_description);
|
||||
}
|
||||
}
|
||||
if (login_errors_.isEmpty()) {
|
||||
|
|
|
@ -138,7 +138,6 @@ return_song:
|
|||
|
||||
void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir, Playlist::Path path_type) const {
|
||||
|
||||
QFileInfo file;
|
||||
QXmlStreamWriter writer(device);
|
||||
writer.setAutoFormatting(true);
|
||||
writer.setAutoFormattingIndent(2);
|
||||
|
|
|
@ -113,7 +113,6 @@ QByteArray QobuzBaseRequest::GetReplyData(QNetworkReply *reply) {
|
|||
if (parse_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
|
||||
QJsonObject json_obj = json_doc.object();
|
||||
if (!json_obj.isEmpty() && json_obj.contains("status") && json_obj.contains("code") && json_obj.contains("message")) {
|
||||
QString status = json_obj["status"].toString();
|
||||
int code = json_obj["code"].toInt();
|
||||
QString message = json_obj["message"].toString();
|
||||
error = QString("%1 (%2)").arg(message).arg(code);
|
||||
|
|
|
@ -146,7 +146,7 @@ void QobuzFavoriteRequest::AddFavoritesReply(QNetworkReply *reply, const Favorit
|
|||
return;
|
||||
}
|
||||
|
||||
QByteArray data = GetReplyData(reply);
|
||||
GetReplyData(reply);
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
return;
|
||||
|
@ -248,7 +248,7 @@ void QobuzFavoriteRequest::RemoveFavoritesReply(QNetworkReply *reply, const Favo
|
|||
return;
|
||||
}
|
||||
|
||||
QByteArray data = GetReplyData(reply);
|
||||
GetReplyData(reply);
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ QobuzService::QobuzService(Application *app, QObject *parent)
|
|||
QObject::connect(favorite_request_, &QobuzFavoriteRequest::AlbumsRemoved, albums_collection_backend_, &CollectionBackend::DeleteSongs);
|
||||
QObject::connect(favorite_request_, &QobuzFavoriteRequest::SongsRemoved, songs_collection_backend_, &CollectionBackend::DeleteSongs);
|
||||
|
||||
ReloadSettings();
|
||||
QobuzService::ReloadSettings();
|
||||
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,6 @@ void QobuzService::HandleAuthReply(QNetworkReply *reply) {
|
|||
if (json_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
|
||||
QJsonObject json_obj = json_doc.object();
|
||||
if (!json_obj.isEmpty() && json_obj.contains("status") && json_obj.contains("code") && json_obj.contains("message")) {
|
||||
QString status = json_obj["status"].toString();
|
||||
int code = json_obj["code"].toInt();
|
||||
QString message = json_obj["message"].toString();
|
||||
login_errors_ << QString("%1 (%2)").arg(message).arg(code);
|
||||
|
|
|
@ -80,7 +80,7 @@ ListenBrainzScrobbler::ListenBrainzScrobbler(Application *app, QObject *parent)
|
|||
timer_submit_.setSingleShot(true);
|
||||
QObject::connect(&timer_submit_, &QTimer::timeout, this, &ListenBrainzScrobbler::Submit);
|
||||
|
||||
ReloadSettings();
|
||||
ListenBrainzScrobbler::ReloadSettings();
|
||||
LoadSession();
|
||||
|
||||
}
|
||||
|
@ -283,7 +283,6 @@ void ListenBrainzScrobbler::AuthenticateReplyFinished(QNetworkReply *reply) {
|
|||
if (json_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
|
||||
QJsonObject json_obj = json_doc.object();
|
||||
if (json_obj.contains("error") && json_obj.contains("error_description")) {
|
||||
QString error_code = json_obj["error"].toString();
|
||||
error = json_obj["error_description"].toString();
|
||||
}
|
||||
}
|
||||
|
@ -307,7 +306,6 @@ void ListenBrainzScrobbler::AuthenticateReplyFinished(QNetworkReply *reply) {
|
|||
}
|
||||
|
||||
if (json_obj.contains("error") && json_obj.contains("error_description")) {
|
||||
QString error = json_obj["error"].toString();
|
||||
QString failure_reason = json_obj["error_description"].toString();
|
||||
AuthError(failure_reason);
|
||||
return;
|
||||
|
@ -479,7 +477,6 @@ void ListenBrainzScrobbler::UpdateNowPlayingRequestFinished(QNetworkReply *reply
|
|||
}
|
||||
|
||||
if (json_obj.contains("code") && json_obj.contains("error_description")) {
|
||||
QString error_code = json_obj["code"].toString();
|
||||
QString error_desc = json_obj["error_description"].toString();
|
||||
Error(error_desc);
|
||||
return;
|
||||
|
@ -609,7 +606,6 @@ void ListenBrainzScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, QList<
|
|||
}
|
||||
|
||||
if (json_obj.contains("code") && json_obj.contains("error_description")) {
|
||||
QString error_code = json_obj["code"].toString();
|
||||
QString error_desc = json_obj["error_description"].toString();
|
||||
Error(error_desc);
|
||||
cache_->ClearSent(list);
|
||||
|
|
|
@ -239,7 +239,7 @@ void ScrobblingAPI20::RequestSession(const QString &token) {
|
|||
session_url_query.addQueryItem("method", "auth.getSession");
|
||||
session_url_query.addQueryItem("token", token);
|
||||
QString data_to_sign;
|
||||
for (QPair<QString, QString> param : session_url_query.queryItems()) {
|
||||
for (const QPair<QString, QString> ¶m : session_url_query.queryItems()) {
|
||||
data_to_sign += param.first + param.second;
|
||||
}
|
||||
data_to_sign += kSecret;
|
||||
|
@ -764,14 +764,14 @@ void ScrobblingAPI20::ScrobbleRequestFinished(QNetworkReply *reply, QList<quint6
|
|||
continue;
|
||||
}
|
||||
|
||||
QString artist = obj_artist["#text"].toString();
|
||||
QString album = obj_album["#text"].toString();
|
||||
//QString artist = obj_artist["#text"].toString();
|
||||
//QString album = obj_album["#text"].toString();
|
||||
QString song = obj_song["#text"].toString();
|
||||
bool ignoredmessage = obj_ignoredmessage["code"].toVariant().toBool();
|
||||
QString ignoredmessage_text = obj_ignoredmessage["#text"].toString();
|
||||
|
||||
if (ignoredmessage) {
|
||||
Error(QString("Scrobble for \"%1\" ignored: %2").arg(song).arg(ignoredmessage_text));
|
||||
Error(QString("Scrobble for \"%1\" ignored: %2").arg(song, ignoredmessage_text));
|
||||
}
|
||||
else {
|
||||
qLog(Debug) << name_ << "Scrobble for" << song << "accepted";
|
||||
|
@ -917,8 +917,8 @@ void ScrobblingAPI20::SingleScrobbleRequestFinished(QNetworkReply *reply, quint6
|
|||
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();
|
||||
QString song = json_obj_song["#text"].toString();
|
||||
|
||||
int accepted = obj_attr["accepted"].toVariant().toInt();
|
||||
|
@ -1015,7 +1015,7 @@ void ScrobblingAPI20::Error(const QString &error, const QVariant &debug) {
|
|||
qLog(Error) << name_ << error;
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 error: %2").arg(name_).arg(error)); }
|
||||
if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 error: %2").arg(name_, error)); }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -163,8 +163,7 @@ void TidalFavoriteRequest::AddFavoritesReply(QNetworkReply *reply, const Favorit
|
|||
return;
|
||||
}
|
||||
|
||||
QString error;
|
||||
QByteArray data = GetReplyData(reply, false);
|
||||
GetReplyData(reply, false);
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
return;
|
||||
|
@ -270,8 +269,7 @@ void TidalFavoriteRequest::RemoveFavoritesReply(QNetworkReply *reply, const Favo
|
|||
return;
|
||||
}
|
||||
|
||||
QString error;
|
||||
QByteArray data = GetReplyData(reply, false);
|
||||
GetReplyData(reply, false);
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -671,8 +671,8 @@ void TidalRequest::AlbumsReceived(QNetworkReply *reply, const QString &artist_id
|
|||
}
|
||||
QString artist = obj_artist["name"].toString();
|
||||
|
||||
QString quality = obj_item["audioQuality"].toString();
|
||||
QString copyright = obj_item["copyright"].toString();
|
||||
//QString quality = obj_item["audioQuality"].toString();
|
||||
//QString copyright = obj_item["copyright"].toString();
|
||||
|
||||
//qLog(Debug) << "Tidal:" << artist << album << quality << copyright;
|
||||
|
||||
|
@ -977,7 +977,7 @@ QString TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Q
|
|||
QJsonValue value_artist = json_obj["artist"];
|
||||
QJsonValue value_album = json_obj["album"];
|
||||
QJsonValue json_duration = json_obj["duration"];
|
||||
QJsonArray array_artists = json_obj["artists"].toArray();
|
||||
//QJsonArray array_artists = json_obj["artists"].toArray();
|
||||
|
||||
QString song_id;
|
||||
if (json_obj["id"].isString()) {
|
||||
|
@ -988,7 +988,7 @@ QString TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Q
|
|||
}
|
||||
|
||||
QString title = json_obj["title"].toString();
|
||||
QString urlstr = json_obj["url"].toString();
|
||||
//QString urlstr = json_obj["url"].toString();
|
||||
int track = json_obj["trackNumber"].toInt();
|
||||
int disc = json_obj["volumeNumber"].toInt();
|
||||
bool allow_streaming = json_obj["allowStreaming"].toBool();
|
||||
|
@ -1038,12 +1038,12 @@ QString TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Q
|
|||
QString cover = obj_album["cover"].toString();
|
||||
|
||||
if (!allow_streaming) {
|
||||
Warn(QString("Song %1 %2 %3 is not allowStreaming").arg(artist).arg(album).arg(title));
|
||||
Warn(QString("Song %1 %2 %3 is not allowStreaming").arg(artist, album, title));
|
||||
return QString();
|
||||
}
|
||||
|
||||
if (!stream_ready) {
|
||||
Warn(QString("Song %1 %2 %3 is not streamReady").arg(artist).arg(album).arg(title));
|
||||
Warn(QString("Song %1 %2 %3 is not streamReady").arg(artist, album, title));
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@ -1062,7 +1062,7 @@ QString TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Q
|
|||
}
|
||||
|
||||
cover = cover.replace("-", "/");
|
||||
QUrl cover_url (QString("%1/images/%2/%3.jpg").arg(kResourcesUrl).arg(cover).arg(coversize_));
|
||||
QUrl cover_url (QString("%1/images/%2/%3.jpg").arg(kResourcesUrl, cover, coversize_));
|
||||
|
||||
title.remove(Song::kTitleRemoveMisc);
|
||||
|
||||
|
@ -1188,7 +1188,7 @@ void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album
|
|||
|
||||
QString mimetype = reply->header(QNetworkRequest::ContentTypeHeader).toString();
|
||||
if (!ImageUtils::SupportedImageMimeTypes().contains(mimetype, Qt::CaseInsensitive) && !ImageUtils::SupportedImageFormats().contains(mimetype, Qt::CaseInsensitive)) {
|
||||
Error(QString("Unsupported mimetype for image reader %1 for %2").arg(mimetype).arg(url.toString()));
|
||||
Error(QString("Unsupported mimetype for image reader %1 for %2").arg(mimetype, url.toString()));
|
||||
if (album_covers_requests_sent_.contains(album_id)) album_covers_requests_sent_.remove(album_id);
|
||||
AlbumCoverFinishCheck();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue