MusicBrainzClient: Formatting
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* Strawberry Music Player
|
* Strawberry Music Player
|
||||||
* This file was part of Clementine.
|
* This file was part of Clementine.
|
||||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||||
* Copyright 2019-2021, Jonas Kvinge <jonas@jkvinge.net>
|
* Copyright 2019-2025, Jonas Kvinge <jonas@jkvinge.net>
|
||||||
*
|
*
|
||||||
* Strawberry is free software: you can redistribute it and/or modify
|
* Strawberry is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
@@ -163,9 +162,9 @@ void MusicBrainzClient::StartDiscIdRequest(const QString &discid) {
|
|||||||
QUrl url(QString::fromLatin1(kDiscUrl) + discid);
|
QUrl url(QString::fromLatin1(kDiscUrl) + discid);
|
||||||
url.setQuery(url_query);
|
url.setQuery(url_query);
|
||||||
|
|
||||||
QNetworkRequest req(url);
|
QNetworkRequest network_request(url);
|
||||||
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
network_request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
QNetworkReply *reply = network_->get(req);
|
QNetworkReply *reply = network_->get(network_request);
|
||||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, discid, reply]() { DiscIdRequestFinished(discid, reply); });
|
QObject::connect(reply, &QNetworkReply::finished, this, [this, discid, reply]() { DiscIdRequestFinished(discid, reply); });
|
||||||
|
|
||||||
timeouts_->AddReply(reply);
|
timeouts_->AddReply(reply);
|
||||||
@@ -176,7 +175,7 @@ void MusicBrainzClient::FlushRequests() {
|
|||||||
|
|
||||||
if (!requests_.isEmpty() || requests_pending_.isEmpty()) return;
|
if (!requests_.isEmpty() || requests_pending_.isEmpty()) return;
|
||||||
|
|
||||||
Request request = requests_pending_.take(requests_pending_.firstKey());
|
const Request request = requests_pending_.take(requests_pending_.firstKey());
|
||||||
|
|
||||||
const ParamList params = ParamList() << Param(u"inc"_s, u"artists+releases+media"_s);
|
const ParamList params = ParamList() << Param(u"inc"_s, u"artists+releases+media"_s);
|
||||||
|
|
||||||
@@ -185,9 +184,9 @@ void MusicBrainzClient::FlushRequests() {
|
|||||||
QUrl url(QString::fromLatin1(kTrackUrl) + request.mbid);
|
QUrl url(QString::fromLatin1(kTrackUrl) + request.mbid);
|
||||||
url.setQuery(url_query);
|
url.setQuery(url_query);
|
||||||
|
|
||||||
QNetworkRequest req(url);
|
QNetworkRequest network_request(url);
|
||||||
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
network_request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
QNetworkReply *reply = network_->get(req);
|
QNetworkReply *reply = network_->get(network_request);
|
||||||
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { RequestFinished(reply, request.id, request.number); });
|
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { RequestFinished(reply, request.id, request.number); });
|
||||||
requests_.insert(request.id, reply);
|
requests_.insert(request.id, reply);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Strawberry Music Player
|
* Strawberry Music Player
|
||||||
* This file was part of Clementine.
|
* This file was part of Clementine.
|
||||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||||
* Copyright 2019-2021, Jonas Kvinge <jonas@jkvinge.net>
|
* Copyright 2019-2025, Jonas Kvinge <jonas@jkvinge.net>
|
||||||
*
|
*
|
||||||
* Strawberry is free software: you can redistribute it and/or modify
|
* Strawberry is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Reference in New Issue
Block a user