Use 4arg connects for networkreplies
This commit is contained in:
@@ -145,7 +145,7 @@ void TidalFavoriteRequest::AddFavorites(const FavoriteType type, const SongList
|
||||
if (!session_id().isEmpty()) req.setRawHeader("X-Tidal-SessionId", session_id().toUtf8());
|
||||
QByteArray query = url_query.toString(QUrl::FullyEncoded).toUtf8();
|
||||
QNetworkReply *reply = network_->post(req, query);
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, type, songs]() { AddFavoritesReply(reply, type, songs); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, type, songs]() { AddFavoritesReply(reply, type, songs); });
|
||||
replies_ << reply;
|
||||
|
||||
qLog(Debug) << "Tidal: Sending request" << url << query;
|
||||
@@ -252,7 +252,7 @@ void TidalFavoriteRequest::RemoveFavorites(const FavoriteType type, const QStrin
|
||||
if (!access_token().isEmpty()) req.setRawHeader("authorization", "Bearer " + access_token().toUtf8());
|
||||
if (!session_id().isEmpty()) req.setRawHeader("X-Tidal-SessionId", session_id().toUtf8());
|
||||
QNetworkReply *reply = network_->deleteResource(req);
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, type, songs]() { RemoveFavoritesReply(reply, type, songs); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, type, songs]() { RemoveFavoritesReply(reply, type, songs); });
|
||||
replies_ << reply;
|
||||
|
||||
qLog(Debug) << "Tidal: Sending request" << url << "with" << songs.count() << "songs";
|
||||
|
||||
@@ -190,7 +190,7 @@ void TidalRequest::FlushArtistsRequests() {
|
||||
}
|
||||
if (!reply) continue;
|
||||
replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { ArtistsReplyReceived(reply, request.limit, request.offset); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { ArtistsReplyReceived(reply, request.limit, request.offset); });
|
||||
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ void TidalRequest::FlushAlbumsRequests() {
|
||||
}
|
||||
if (!reply) continue;
|
||||
replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { AlbumsReplyReceived(reply, request.limit, request.offset); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { AlbumsReplyReceived(reply, request.limit, request.offset); });
|
||||
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ void TidalRequest::FlushSongsRequests() {
|
||||
}
|
||||
if (!reply) continue;
|
||||
replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { SongsReplyReceived(reply, request.limit, request.offset); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { SongsReplyReceived(reply, request.limit, request.offset); });
|
||||
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ void TidalRequest::FlushArtistAlbumsRequests() {
|
||||
ParamList parameters;
|
||||
if (request.offset > 0) parameters << Param("offset", QString::number(request.offset));
|
||||
QNetworkReply *reply = CreateRequest(QString("artists/%1/albums").arg(request.artist_id), parameters);
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { ArtistAlbumsReplyReceived(reply, request.artist_id, request.offset); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { ArtistAlbumsReplyReceived(reply, request.artist_id, request.offset); });
|
||||
replies_ << reply;
|
||||
|
||||
}
|
||||
@@ -784,7 +784,7 @@ void TidalRequest::FlushAlbumSongsRequests() {
|
||||
if (request.offset > 0) parameters << Param("offset", QString::number(request.offset));
|
||||
QNetworkReply *reply = CreateRequest(QString("albums/%1/tracks").arg(request.album_id), parameters);
|
||||
replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { AlbumSongsReplyReceived(reply, request.artist_id, request.album_id, request.offset, request.album_artist, request.album, request.album_explicit); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { AlbumSongsReplyReceived(reply, request.artist_id, request.album_id, request.offset, request.album_artist, request.album, request.album_explicit); });
|
||||
|
||||
}
|
||||
|
||||
@@ -1142,7 +1142,7 @@ void TidalRequest::FlushAlbumCoverRequests() {
|
||||
#endif
|
||||
QNetworkReply *reply = network_->get(req);
|
||||
album_cover_replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { AlbumCoverReceived(reply, request.album_id, request.url, request.filename); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { AlbumCoverReceived(reply, request.album_id, request.url, request.filename); });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ void TidalService::RequestAccessToken(const QString &code) {
|
||||
QNetworkReply *reply = network_->post(req, query);
|
||||
replies_ << reply;
|
||||
QObject::connect(reply, &QNetworkReply::sslErrors, this, &TidalService::HandleLoginSSLErrors);
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply]() { AccessTokenRequestFinished(reply); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() { AccessTokenRequestFinished(reply); });
|
||||
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ void TidalService::SendLoginWithCredentials(const QString &api_token, const QStr
|
||||
QByteArray query = url_query.toString(QUrl::FullyEncoded).toUtf8();
|
||||
QNetworkReply *reply = network_->post(req, query);
|
||||
QObject::connect(reply, &QNetworkReply::sslErrors, this, &TidalService::HandleLoginSSLErrors);
|
||||
QObject::connect(reply, &QNetworkReply::finished, [this, reply]() { HandleAuthReply(reply); });
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() { HandleAuthReply(reply); });
|
||||
replies_ << reply;
|
||||
|
||||
//qLog(Debug) << "Tidal: Sending request" << url << query;
|
||||
|
||||
Reference in New Issue
Block a user