Formatting
This commit is contained in:
@@ -71,11 +71,11 @@ void AcoustidClient::Start(const int id, const QString &fingerprint, int duratio
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
const ParamList params = ParamList () << Param("format", "json")
|
||||
<< Param("client", kClientId)
|
||||
<< Param("duration", QString::number(duration_msec / kMsecPerSec))
|
||||
<< Param("meta", "recordingids+sources")
|
||||
<< Param("fingerprint", fingerprint);
|
||||
const ParamList params = ParamList() << Param("format", "json")
|
||||
<< Param("client", kClientId)
|
||||
<< Param("duration", QString::number(duration_msec / kMsecPerSec))
|
||||
<< Param("meta", "recordingids+sources")
|
||||
<< Param("fingerprint", fingerprint);
|
||||
|
||||
QUrlQuery url_query;
|
||||
url_query.setQueryItems(params);
|
||||
@@ -113,8 +113,7 @@ void AcoustidClient::CancelAll() {
|
||||
namespace {
|
||||
// Struct used when extracting results in RequestFinished
|
||||
struct IdSource {
|
||||
IdSource(const QString &id, const int source)
|
||||
: id_(id), nb_sources_(source) {}
|
||||
IdSource(const QString &id, const int source) : id_(id), nb_sources_(source) {}
|
||||
|
||||
bool operator<(const IdSource &other) const {
|
||||
// We want the items with more sources to be at the beginning of the list
|
||||
|
||||
@@ -81,7 +81,7 @@ QByteArray MusicBrainzClient::GetReplyData(QNetworkReply *reply, QString &error)
|
||||
QByteArray data;
|
||||
|
||||
if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 200) {
|
||||
data = reply->readAll();
|
||||
data = reply->readAll();
|
||||
}
|
||||
else {
|
||||
if (reply->error() != QNetworkReply::NoError && reply->error() < 200) {
|
||||
@@ -220,7 +220,7 @@ void MusicBrainzClient::RequestFinished(QNetworkReply *reply, const int id, cons
|
||||
QXmlStreamReader reader(data);
|
||||
ResultList res;
|
||||
while (!reader.atEnd()) {
|
||||
if (reader.readNext() == QXmlStreamReader::StartElement && reader.name().toString() == "recording") {
|
||||
if (reader.readNext() == QXmlStreamReader::StartElement && reader.name().toString() == "recording") {
|
||||
ResultList tracks = ParseTrack(&reader);
|
||||
for (const Result &track : tracks) {
|
||||
if (!track.title_.isEmpty()) {
|
||||
|
||||
@@ -58,7 +58,7 @@ void TagFetcher::StartFetch(const SongList &songs) {
|
||||
songs_ = songs;
|
||||
|
||||
bool have_fingerprints = true;
|
||||
if (std::any_of(songs.begin(), songs.end(), [](const Song &song){ return song.fingerprint().isEmpty(); })) {
|
||||
if (std::any_of(songs.begin(), songs.end(), [](const Song &song) { return song.fingerprint().isEmpty(); })) {
|
||||
have_fingerprints = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user