Formatting

This commit is contained in:
Jonas Kvinge
2025-12-08 23:49:48 +01:00
parent 109ff90401
commit 93af866185
179 changed files with 1187 additions and 1269 deletions

View File

@@ -116,7 +116,7 @@ QNetworkReply *SubsonicBaseRequest::CreateGetRequest(const QString &ressource_na
QNetworkReply *reply = network_->get(network_request);
QObject::connect(reply, &QNetworkReply::sslErrors, this, &SubsonicBaseRequest::HandleSSLErrors);
//qLog(Debug) << "Subsonic: Sending request" << url;
// qLog(Debug) << "Subsonic: Sending request" << url;
return reply;
@@ -184,7 +184,7 @@ JsonBaseRequest::JsonObjectResult SubsonicBaseRequest::ParseJsonObject(QNetworkR
}
if (reply->error() == QNetworkReply::AuthenticationRequiredError) {
//service_->ClearSession();
// service_->ClearSession();
}
return result;

View File

@@ -421,15 +421,13 @@ void SubsonicRequest::SongsFinishCheck() {
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
if (
download_album_covers() &&
if (download_album_covers() &&
album_songs_requests_queue_.isEmpty() &&
album_songs_requests_active_ <= 0 &&
album_cover_requests_queue_.isEmpty() &&
album_covers_received_ <= 0 &&
album_covers_requests_sent_.isEmpty() &&
album_songs_received_ >= album_songs_requested_
) {
album_songs_received_ >= album_songs_requested_) {
GetAlbumCovers();
}
@@ -442,14 +440,12 @@ QString SubsonicRequest::ParseSong(Song &song, const QJsonObject &json_object, c
Q_UNUSED(artist_id_requested);
Q_UNUSED(album_id_requested);
if (
!json_object.contains("id"_L1) ||
if (!json_object.contains("id"_L1) ||
!json_object.contains("title"_L1) ||
!json_object.contains("size"_L1) ||
!json_object.contains("suffix"_L1) ||
!json_object.contains("duration"_L1) ||
!json_object.contains("type"_L1)
) {
!json_object.contains("type"_L1)) {
Error(u"Invalid Json reply, song is missing one or more values."_s, json_object);
return QString();
}
@@ -813,8 +809,7 @@ void SubsonicRequest::AlbumCoverFinishCheck() {
void SubsonicRequest::FinishCheck() {
if (
!finished_ &&
if (!finished_ &&
albums_requests_queue_.isEmpty() &&
album_songs_requests_queue_.isEmpty() &&
album_cover_requests_queue_.isEmpty() &&
@@ -824,8 +819,7 @@ void SubsonicRequest::FinishCheck() {
album_songs_requests_active_ <= 0 &&
album_songs_received_ >= album_songs_requested_ &&
album_covers_requests_active_ <= 0 &&
album_covers_received_ >= album_covers_requested_
) {
album_covers_received_ >= album_covers_requested_) {
finished_ = true;
if (no_results_ && songs_.isEmpty()) {
Q_EMIT Results(SongMap(), QString());

View File

@@ -202,7 +202,7 @@ void SubsonicService::SendPingWithCredentials(QUrl url, const QString &username,
QObject::connect(reply, &QNetworkReply::sslErrors, this, &SubsonicService::HandlePingSSLErrors);
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, url, username, password, auth_method]() { HandlePingReply(reply, url, username, password, auth_method); });
//qLog(Debug) << "Subsonic: Sending request" << url << url.query();
// qLog(Debug) << "Subsonic: Sending request" << url << url.query();
}
@@ -332,7 +332,7 @@ void SubsonicService::HandlePingReply(QNetworkReply *reply, const QUrl &url, con
PingError(u"Authentication error reply from server is missing status or message"_s, json_obj);
return;
}
//int status = obj_error["code"].toInt();
// int status = obj_error["code"].toInt();
QString message = obj_error["message"_L1].toString();
Q_EMIT TestComplete(false, message);
Q_EMIT TestFailure(message);