Formatting
This commit is contained in:
@@ -163,4 +163,3 @@ extern "C" void Discord_Register(const char *applicationId, const char *command)
|
|||||||
Discord_RegisterW(appId, wcommand);
|
Discord_RegisterW(appId, wcommand);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,4 +90,3 @@ class AnalyzerBase : public QWidget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // ANALYZERBASE_H
|
#endif // ANALYZERBASE_H
|
||||||
|
|
||||||
|
|||||||
@@ -331,4 +331,3 @@ class CollectionBackend : public CollectionBackendInterface {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLLECTIONBACKEND_H
|
#endif // COLLECTIONBACKEND_H
|
||||||
|
|
||||||
|
|||||||
@@ -135,4 +135,3 @@ class CollectionFilterWidget : public QWidget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLLECTIONFILTERWIDGET_H
|
#endif // COLLECTIONFILTERWIDGET_H
|
||||||
|
|
||||||
|
|||||||
@@ -58,4 +58,3 @@ class CollectionPlaylistItem : public PlaylistItem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLLECTIONPLAYLISTITEM_H
|
#endif // COLLECTIONPLAYLISTITEM_H
|
||||||
|
|
||||||
|
|||||||
@@ -26,4 +26,3 @@ constexpr char kSettingsGroup[] = "Transcoder";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // TRANSCODERSETTINGS_H
|
#endif // TRANSCODERSETTINGS_H
|
||||||
|
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ using namespace std::chrono_literals;
|
|||||||
|
|
||||||
class ApplicationImpl {
|
class ApplicationImpl {
|
||||||
public:
|
public:
|
||||||
explicit ApplicationImpl(Application *app) :
|
explicit ApplicationImpl(Application *app)
|
||||||
tagreader_client_([app](){
|
: tagreader_client_([app](){
|
||||||
TagReaderClient *client = new TagReaderClient();
|
TagReaderClient *client = new TagReaderClient();
|
||||||
app->MoveToNewThread(client);
|
app->MoveToNewThread(client);
|
||||||
return client;
|
return client;
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ constexpr char kMagicAllSongsTables[] = "%allsongstables";
|
|||||||
int Database::sNextConnectionId = 1;
|
int Database::sNextConnectionId = 1;
|
||||||
QMutex Database::sNextConnectionIdMutex;
|
QMutex Database::sNextConnectionIdMutex;
|
||||||
|
|
||||||
Database::Database(SharedPtr<TaskManager> task_manager, QObject *parent, const QString &database_name) :
|
Database::Database(SharedPtr<TaskManager> task_manager, QObject *parent, const QString &database_name)
|
||||||
QObject(parent),
|
: QObject(parent),
|
||||||
task_manager_(task_manager),
|
task_manager_(task_manager),
|
||||||
injected_database_name_(database_name),
|
injected_database_name_(database_name),
|
||||||
query_hash_(0),
|
query_hash_(0),
|
||||||
@@ -594,8 +594,7 @@ void Database::BackupFile(const QString &filename) {
|
|||||||
ret = sqlite3_backup_step(backup, 16);
|
ret = sqlite3_backup_step(backup, 16);
|
||||||
const int page_count = sqlite3_backup_pagecount(backup);
|
const int page_count = sqlite3_backup_pagecount(backup);
|
||||||
task_manager_->SetTaskProgress(task_id, static_cast<quint64>(page_count - sqlite3_backup_remaining(backup)), static_cast<quint64>(page_count));
|
task_manager_->SetTaskProgress(task_id, static_cast<quint64>(page_count - sqlite3_backup_remaining(backup)), static_cast<quint64>(page_count));
|
||||||
}
|
} while (ret == SQLITE_OK);
|
||||||
while (ret == SQLITE_OK);
|
|
||||||
|
|
||||||
if (ret != SQLITE_DONE) {
|
if (ret != SQLITE_DONE) {
|
||||||
qLog(Error) << "Database backup failed";
|
qLog(Error) << "Database backup failed";
|
||||||
|
|||||||
@@ -155,11 +155,7 @@ void LocalRedirectServer::WriteTemplate() const {
|
|||||||
|
|
||||||
QBuffer image_buffer;
|
QBuffer image_buffer;
|
||||||
if (image_buffer.open(QIODevice::ReadWrite)) {
|
if (image_buffer.open(QIODevice::ReadWrite)) {
|
||||||
QApplication::style()
|
QApplication::style()->standardIcon(QStyle::SP_DialogOkButton).pixmap(16).toImage().save(&image_buffer, "PNG");
|
||||||
->standardIcon(QStyle::SP_DialogOkButton)
|
|
||||||
.pixmap(16)
|
|
||||||
.toImage()
|
|
||||||
.save(&image_buffer, "PNG");
|
|
||||||
page_data.replace("@IMAGE_DATA@"_L1, QString::fromUtf8(image_buffer.data().toBase64()));
|
page_data.replace("@IMAGE_DATA@"_L1, QString::fromUtf8(image_buffer.data().toBase64()));
|
||||||
image_buffer.close();
|
image_buffer.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2150,4 +2150,3 @@ QString Song::GetNameForNewPlaylist(const SongList &songs) {
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -784,4 +784,3 @@ void SongLoader::CleanupPipeline() {
|
|||||||
state_ = State::Finished;
|
state_ = State::Finished;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,3 @@ class SongMimeData : public MimeData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // SONGMIMEDATA_H
|
#endif // SONGMIMEDATA_H
|
||||||
|
|
||||||
|
|||||||
@@ -53,4 +53,3 @@ UrlHandler::LoadResult::LoadResult(const QUrl &media_url, const Type type, const
|
|||||||
bit_depth_(-1),
|
bit_depth_(-1),
|
||||||
length_nanosec_(-1),
|
length_nanosec_(-1),
|
||||||
error_(error) {}
|
error_(error) {}
|
||||||
|
|
||||||
|
|||||||
@@ -806,8 +806,8 @@ void AlbumCoverChoiceController::SaveCover(Song *song, const QDropEvent *e) {
|
|||||||
QUrl AlbumCoverChoiceController::SaveCoverAutomatic(Song *song, const AlbumCoverImageResult &result) {
|
QUrl AlbumCoverChoiceController::SaveCoverAutomatic(Song *song, const AlbumCoverImageResult &result) {
|
||||||
|
|
||||||
QUrl cover_url;
|
QUrl cover_url;
|
||||||
switch(get_save_album_cover_type()) {
|
|
||||||
case CoverOptions::CoverType::Embedded:{
|
case CoverOptions::CoverType::Embedded:{
|
||||||
|
switch (get_save_album_cover_type()) {
|
||||||
if (song->save_embedded_cover_supported()) {
|
if (song->save_embedded_cover_supported()) {
|
||||||
SaveCoverEmbeddedToCollectionSongs(*song, result);
|
SaveCoverEmbeddedToCollectionSongs(*song, result);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -75,4 +75,3 @@ class AlbumCoverExporter : public QObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // ALBUMCOVEREXPORTER_H
|
#endif // ALBUMCOVEREXPORTER_H
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ class AlbumCoverLoaderResult {
|
|||||||
const AlbumCoverImageResult &_album_cover = AlbumCoverImageResult(),
|
const AlbumCoverImageResult &_album_cover = AlbumCoverImageResult(),
|
||||||
const QImage &_image_scaled = QImage(),
|
const QImage &_image_scaled = QImage(),
|
||||||
const QUrl &_art_manual_updated = QUrl(),
|
const QUrl &_art_manual_updated = QUrl(),
|
||||||
const QUrl &_art_automatic_updated = QUrl()) :
|
const QUrl &_art_automatic_updated = QUrl())
|
||||||
success(_success),
|
: success(_success),
|
||||||
type(_type),
|
type(_type),
|
||||||
album_cover(_album_cover),
|
album_cover(_album_cover),
|
||||||
image_scaled(_image_scaled),
|
image_scaled(_image_scaled),
|
||||||
|
|||||||
@@ -604,10 +604,7 @@ void AlbumCoverManager::AlbumCoverFetched(const quint64 id, const AlbumCoverImag
|
|||||||
|
|
||||||
void AlbumCoverManager::UpdateStatusText() {
|
void AlbumCoverManager::UpdateStatusText() {
|
||||||
|
|
||||||
QString message = tr("Got %1 covers out of %2 (%3 failed)")
|
QString message = tr("Got %1 covers out of %2 (%3 failed)").arg(fetch_statistics_.chosen_images_).arg(jobs_).arg(fetch_statistics_.missing_images_);
|
||||||
.arg(fetch_statistics_.chosen_images_)
|
|
||||||
.arg(jobs_)
|
|
||||||
.arg(fetch_statistics_.missing_images_);
|
|
||||||
|
|
||||||
if (fetch_statistics_.bytes_transferred_ > 0) {
|
if (fetch_statistics_.bytes_transferred_ > 0) {
|
||||||
message += ", "_L1 + tr("%1 transferred").arg(Utilities::PrettySize(fetch_statistics_.bytes_transferred_));
|
message += ", "_L1 + tr("%1 transferred").arg(Utilities::PrettySize(fetch_statistics_.bytes_transferred_));
|
||||||
@@ -1083,10 +1080,7 @@ void AlbumCoverManager::UpdateExportStatus(const int exported, const int skipped
|
|||||||
|
|
||||||
progress_bar_->setValue(exported);
|
progress_bar_->setValue(exported);
|
||||||
|
|
||||||
QString message = tr("Exported %1 covers out of %2 (%3 skipped)")
|
QString message = tr("Exported %1 covers out of %2 (%3 skipped)").arg(exported).arg(max).arg(skipped);
|
||||||
.arg(exported)
|
|
||||||
.arg(max)
|
|
||||||
.arg(skipped);
|
|
||||||
statusBar()->showMessage(message);
|
statusBar()->showMessage(message);
|
||||||
|
|
||||||
// End of the current process
|
// End of the current process
|
||||||
@@ -1131,4 +1125,3 @@ void AlbumCoverManager::SaveEmbeddedCoverFinished(TagReaderReplyPtr reply, Album
|
|||||||
LoadAlbumCoverAsync(album_item);
|
LoadAlbumCoverAsync(album_item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ CoverSearchStatisticsDialog::CoverSearchStatisticsDialog(QWidget *parent)
|
|||||||
details_layout_ = new QVBoxLayout(ui_->details);
|
details_layout_ = new QVBoxLayout(ui_->details);
|
||||||
details_layout_->setSpacing(0);
|
details_layout_->setSpacing(0);
|
||||||
|
|
||||||
setStyleSheet(
|
setStyleSheet(u"#details {"
|
||||||
u"#details {"
|
|
||||||
" background-color: palette(base);"
|
" background-color: palette(base);"
|
||||||
"}"
|
"}"
|
||||||
"#details QLabel[type=\"label\"] {"
|
"#details QLabel[type=\"label\"] {"
|
||||||
@@ -67,10 +66,7 @@ void CoverSearchStatisticsDialog::Show(const CoverSearchStatistics &statistics)
|
|||||||
QStringList providers(statistics.total_images_by_provider_.keys());
|
QStringList providers(statistics.total_images_by_provider_.keys());
|
||||||
std::sort(providers.begin(), providers.end());
|
std::sort(providers.begin(), providers.end());
|
||||||
|
|
||||||
ui_->summary->setText(tr("Got %1 covers out of %2 (%3 failed)")
|
ui_->summary->setText(tr("Got %1 covers out of %2 (%3 failed)").arg(statistics.chosen_images_).arg(statistics.chosen_images_ + statistics.missing_images_).arg(statistics.missing_images_));
|
||||||
.arg(statistics.chosen_images_)
|
|
||||||
.arg(statistics.chosen_images_ + statistics.missing_images_)
|
|
||||||
.arg(statistics.missing_images_));
|
|
||||||
|
|
||||||
for (const QString &provider : std::as_const(providers)) {
|
for (const QString &provider : std::as_const(providers)) {
|
||||||
AddLine(tr("Covers from %1").arg(provider), QString::number(statistics.chosen_images_by_provider_[provider]));
|
AddLine(tr("Covers from %1").arg(provider), QString::number(statistics.chosen_images_by_provider_[provider]));
|
||||||
|
|||||||
@@ -138,4 +138,3 @@ void CDDADevice::SongLoadingFinished() {
|
|||||||
WatchForDiscChanges(true);
|
WatchForDiscChanges(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -227,8 +227,7 @@ void DeviceDatabaseBackend::SetDeviceOptions(const int id, const QString &friend
|
|||||||
QSqlDatabase db(db_->Connect());
|
QSqlDatabase db(db_->Connect());
|
||||||
|
|
||||||
SqlQuery q(db);
|
SqlQuery q(db);
|
||||||
q.prepare(QStringLiteral(
|
q.prepare(QStringLiteral("UPDATE devices"
|
||||||
"UPDATE devices"
|
|
||||||
" SET friendly_name=:friendly_name,"
|
" SET friendly_name=:friendly_name,"
|
||||||
" icon=:icon_name,"
|
" icon=:icon_name,"
|
||||||
" transcode_mode=:transcode_mode,"
|
" transcode_mode=:transcode_mode,"
|
||||||
|
|||||||
@@ -411,10 +411,7 @@ Udisks2Lister::PartitionData Udisks2Lister::ReadPartitionData(const QDBusObjectP
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString Udisks2Lister::PartitionData::unique_id() const {
|
QString Udisks2Lister::PartitionData::unique_id() const {
|
||||||
return u"Udisks2/%1/%2/%3/%4/%5"_s
|
return u"Udisks2/%1/%2/%3/%4/%5"_s.arg(serial, vendor, model).arg(capacity).arg(uuid);
|
||||||
.arg(serial, vendor, model)
|
|
||||||
.arg(capacity)
|
|
||||||
.arg(uuid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Udisks2Lister::Udisks2Job::Udisks2Job() : is_mount(true) {}
|
Udisks2Lister::Udisks2Job::Udisks2Job() : is_mount(true) {}
|
||||||
|
|||||||
@@ -419,8 +419,7 @@ std::optional<EBUR128Measures> EBUR128AnalysisImpl::Compute(const Song &song) {
|
|||||||
// Connect the elements
|
// Connect the elements
|
||||||
gst_element_link_many(src, decode, nullptr);
|
gst_element_link_many(src, decode, nullptr);
|
||||||
|
|
||||||
GstStaticCaps static_caps = GST_STATIC_CAPS(
|
GstStaticCaps static_caps = GST_STATIC_CAPS("audio/x-raw,"
|
||||||
"audio/x-raw,"
|
|
||||||
"format = (string) { S16LE, S32LE, F32LE, F64LE },"
|
"format = (string) { S16LE, S32LE, F32LE, F64LE },"
|
||||||
"layout = (string) interleaved");
|
"layout = (string) interleaved");
|
||||||
|
|
||||||
|
|||||||
@@ -1064,8 +1064,7 @@ void GstEngine::UpdateScope(const int chunk_length) {
|
|||||||
buffer_format_.startsWith("S24LE"_L1) ||
|
buffer_format_.startsWith("S24LE"_L1) ||
|
||||||
buffer_format_.startsWith("S24_32LE"_L1) ||
|
buffer_format_.startsWith("S24_32LE"_L1) ||
|
||||||
buffer_format_.startsWith("S32LE"_L1) ||
|
buffer_format_.startsWith("S32LE"_L1) ||
|
||||||
buffer_format_.startsWith("F32LE"_L1)
|
buffer_format_.startsWith("F32LE"_L1)) {
|
||||||
) {
|
|
||||||
memcpy(dest, source, bytes);
|
memcpy(dest, source, bytes);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -147,4 +147,3 @@ PulseDeviceFinder::~PulseDeviceFinder() {
|
|||||||
pa_mainloop_free(mainloop_);
|
pa_mainloop_free(mainloop_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,4 +68,3 @@ int EqualizerSlider::value() const {
|
|||||||
void EqualizerSlider::set_value(const int value) {
|
void EqualizerSlider::set_value(const int value) {
|
||||||
ui_->slider->setValue(value);
|
ui_->slider->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ class FilterParserIntEqComparator : public FilterParserSearchTermComparator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // FILTERPARSERINTEQCOMPARATOR_H
|
#endif // FILTERPARSERINTEQCOMPARATOR_H
|
||||||
|
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ class FilterParserIntGeComparator : public FilterParserSearchTermComparator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // FILTERPARSERINTGECOMPARATOR_H
|
#endif // FILTERPARSERINTGECOMPARATOR_H
|
||||||
|
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ class FilterParserIntNeComparator : public FilterParserSearchTermComparator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // FILTERPARSERINTNECOMPARATOR_H
|
#endif // FILTERPARSERINTNECOMPARATOR_H
|
||||||
|
|
||||||
|
|||||||
@@ -153,8 +153,7 @@ QString HtmlLyricsProvider::ParseLyricsFromHTML(const QString &content, const QR
|
|||||||
start_idx = rematch_end_tag.capturedEnd();
|
start_idx = rematch_end_tag.capturedEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (tags > 0 && (rematch_start_tag.hasMatch() || rematch_end_tag.hasMatch()));
|
||||||
while (tags > 0 && (rematch_start_tag.hasMatch() || rematch_end_tag.hasMatch()));
|
|
||||||
|
|
||||||
if (end_lyrics_idx != -1 && start_lyrics_idx < end_lyrics_idx) {
|
if (end_lyrics_idx != -1 && start_lyrics_idx < end_lyrics_idx) {
|
||||||
if (!lyrics.isEmpty()) {
|
if (!lyrics.isEmpty()) {
|
||||||
@@ -163,8 +162,7 @@ QString HtmlLyricsProvider::ParseLyricsFromHTML(const QString &content, const QR
|
|||||||
lyrics.append(content.mid(start_lyrics_idx, end_lyrics_idx - start_lyrics_idx).remove(u'\r').remove(u'\n'));
|
lyrics.append(content.mid(start_lyrics_idx, end_lyrics_idx - start_lyrics_idx).remove(u'\r').remove(u'\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} while (start_idx > 0 && multiple);
|
||||||
while (start_idx > 0 && multiple);
|
|
||||||
|
|
||||||
for (auto it = regex_removes.cbegin(); it != regex_removes.cend(); it++) {
|
for (auto it = regex_removes.cbegin(); it != regex_removes.cend(); it++) {
|
||||||
lyrics.remove(*it);
|
lyrics.remove(*it);
|
||||||
|
|||||||
@@ -524,4 +524,3 @@ MusicBrainzClient::ResultList MusicBrainzClient::UniqueResults(const ResultList
|
|||||||
return unique_results;
|
return unique_results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -193,4 +193,3 @@ void OSDDBus::CallFinished(QDBusPendingCallWatcher *watcher) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,8 +231,7 @@ void PlaylistTabBar::CloseSlot() {
|
|||||||
confirmation_box.setWindowIcon(QIcon(u":/icons/64x64/strawberry.png"_s));
|
confirmation_box.setWindowIcon(QIcon(u":/icons/64x64/strawberry.png"_s));
|
||||||
confirmation_box.setWindowTitle(tr("Remove playlist"));
|
confirmation_box.setWindowTitle(tr("Remove playlist"));
|
||||||
confirmation_box.setIcon(QMessageBox::Question);
|
confirmation_box.setIcon(QMessageBox::Question);
|
||||||
confirmation_box.setText(
|
confirmation_box.setText(tr("You are about to remove a playlist which is not part of your "
|
||||||
tr("You are about to remove a playlist which is not part of your "
|
|
||||||
"favorite playlists: "
|
"favorite playlists: "
|
||||||
"the playlist will be deleted (this action cannot be undone). \n"
|
"the playlist will be deleted (this action cannot be undone). \n"
|
||||||
"Are you sure you want to continue?"));
|
"Are you sure you want to continue?"));
|
||||||
|
|||||||
@@ -184,4 +184,3 @@ void RadioView::Donate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,15 +118,13 @@ void ScrobblerCache::ReadCache() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QJsonObject json_obj_track = value.toObject();
|
QJsonObject json_obj_track = value.toObject();
|
||||||
if (
|
if (!json_obj_track.contains("timestamp"_L1) ||
|
||||||
!json_obj_track.contains("timestamp"_L1) ||
|
|
||||||
!json_obj_track.contains("artist"_L1) ||
|
!json_obj_track.contains("artist"_L1) ||
|
||||||
!json_obj_track.contains("album"_L1) ||
|
!json_obj_track.contains("album"_L1) ||
|
||||||
!json_obj_track.contains("title"_L1) ||
|
!json_obj_track.contains("title"_L1) ||
|
||||||
!json_obj_track.contains("track"_L1) ||
|
!json_obj_track.contains("track"_L1) ||
|
||||||
!json_obj_track.contains("albumartist"_L1) ||
|
!json_obj_track.contains("albumartist"_L1) ||
|
||||||
!json_obj_track.contains("length_nanosec"_L1)
|
!json_obj_track.contains("length_nanosec"_L1)) {
|
||||||
) {
|
|
||||||
qLog(Error) << "Scrobbler cache JSON tracks array value is missing data.";
|
qLog(Error) << "Scrobbler cache JSON tracks array value is missing data.";
|
||||||
qLog(Debug) << value;
|
qLog(Debug) << value;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -339,4 +339,3 @@ void AppearanceSettingsPage::PlaylistPlayingSongSelectColor() {
|
|||||||
set_changed();
|
set_changed();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,10 +94,7 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog *dialog, QWidget *pa
|
|||||||
if (!re_match.hasMatch()) continue;
|
if (!re_match.hasMatch()) continue;
|
||||||
|
|
||||||
QString code = re_match.captured(1);
|
QString code = re_match.captured(1);
|
||||||
QString lookup_code = QString(code)
|
QString lookup_code = QString(code).replace("@latin"_L1, "_Latn"_L1).replace("_CN"_L1, "_Hans_CN"_L1).replace("_TW"_L1, "_Hant_TW"_L1);
|
||||||
.replace("@latin"_L1, "_Latn"_L1)
|
|
||||||
.replace("_CN"_L1, "_Hans_CN"_L1)
|
|
||||||
.replace("_TW"_L1, "_Hant_TW"_L1);
|
|
||||||
|
|
||||||
QString language_name = QLocale::languageToString(QLocale(lookup_code).language());
|
QString language_name = QLocale::languageToString(QLocale(lookup_code).language());
|
||||||
QString native_name = QLocale(lookup_code).nativeLanguageName();
|
QString native_name = QLocale(lookup_code).nativeLanguageName();
|
||||||
|
|||||||
@@ -207,4 +207,3 @@ bool SettingsPage::eventFilter(QObject *obj, QEvent *e) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,4 +39,3 @@ class SmartPlaylistWizardFinishPage : public QWizardPage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMARTPLAYLISTWIZARDFINISHPAGE_H
|
#endif // SMARTPLAYLISTWIZARDFINISHPAGE_H
|
||||||
|
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ class SmartPlaylistWizardTypePage : public QWizardPage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMARTPLAYLISTWIZARDTYPEPAGE_H
|
#endif // SMARTPLAYLISTWIZARDTYPEPAGE_H
|
||||||
|
|
||||||
|
|||||||
@@ -816,14 +816,12 @@ void SpotifyRequest::AlbumsFinishCheck(const Artist &artist, const int limit, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (artists_requests_queue_.isEmpty() &&
|
||||||
artists_requests_queue_.isEmpty() &&
|
|
||||||
artists_requests_active_ <= 0 &&
|
artists_requests_active_ <= 0 &&
|
||||||
albums_requests_queue_.isEmpty() &&
|
albums_requests_queue_.isEmpty() &&
|
||||||
albums_requests_active_ <= 0 &&
|
albums_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_queue_.isEmpty() &&
|
artist_albums_requests_queue_.isEmpty() &&
|
||||||
artist_albums_requests_active_ <= 0
|
artist_albums_requests_active_ <= 0) { // Artist albums query is finished, get all songs for all albums.
|
||||||
) { // Artist albums query is finished, get all songs for all albums.
|
|
||||||
|
|
||||||
// Get songs for all the albums.
|
// Get songs for all the albums.
|
||||||
|
|
||||||
@@ -1039,15 +1037,13 @@ void SpotifyRequest::SongsFinishCheck(const Artist &artist, const Album &album,
|
|||||||
|
|
||||||
void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) {
|
void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) {
|
||||||
|
|
||||||
if (
|
if (!json_obj.contains("type"_L1) ||
|
||||||
!json_obj.contains("type"_L1) ||
|
|
||||||
!json_obj.contains("id"_L1) ||
|
!json_obj.contains("id"_L1) ||
|
||||||
!json_obj.contains("name"_L1) ||
|
!json_obj.contains("name"_L1) ||
|
||||||
!json_obj.contains("uri"_L1) ||
|
!json_obj.contains("uri"_L1) ||
|
||||||
!json_obj.contains("duration_ms"_L1) ||
|
!json_obj.contains("duration_ms"_L1) ||
|
||||||
!json_obj.contains("track_number"_L1) ||
|
!json_obj.contains("track_number"_L1) ||
|
||||||
!json_obj.contains("disc_number"_L1)
|
!json_obj.contains("disc_number"_L1)) {
|
||||||
) {
|
|
||||||
Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj);
|
Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1145,8 +1141,7 @@ void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Ar
|
|||||||
|
|
||||||
void SpotifyRequest::GetAlbumCoversCheck() {
|
void SpotifyRequest::GetAlbumCoversCheck() {
|
||||||
|
|
||||||
if (
|
if (!finished_ &&
|
||||||
!finished_ &&
|
|
||||||
service_->download_album_covers() &&
|
service_->download_album_covers() &&
|
||||||
IsQuery() &&
|
IsQuery() &&
|
||||||
artists_requests_queue_.isEmpty() &&
|
artists_requests_queue_.isEmpty() &&
|
||||||
@@ -1163,8 +1158,7 @@ void SpotifyRequest::GetAlbumCoversCheck() {
|
|||||||
songs_requests_active_ <= 0 &&
|
songs_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_active_ <= 0 &&
|
artist_albums_requests_active_ <= 0 &&
|
||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_covers_requests_active_ <= 0
|
album_covers_requests_active_ <= 0) {
|
||||||
) {
|
|
||||||
GetAlbumCovers();
|
GetAlbumCovers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1306,8 +1300,7 @@ void SpotifyRequest::AlbumCoverFinishCheck() {
|
|||||||
|
|
||||||
void SpotifyRequest::FinishCheck() {
|
void SpotifyRequest::FinishCheck() {
|
||||||
|
|
||||||
if (
|
if (!finished_ &&
|
||||||
!finished_ &&
|
|
||||||
artists_requests_queue_.isEmpty() &&
|
artists_requests_queue_.isEmpty() &&
|
||||||
albums_requests_queue_.isEmpty() &&
|
albums_requests_queue_.isEmpty() &&
|
||||||
songs_requests_queue_.isEmpty() &&
|
songs_requests_queue_.isEmpty() &&
|
||||||
@@ -1322,8 +1315,7 @@ void SpotifyRequest::FinishCheck() {
|
|||||||
songs_requests_active_ <= 0 &&
|
songs_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_active_ <= 0 &&
|
artist_albums_requests_active_ <= 0 &&
|
||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_covers_requests_active_ <= 0
|
album_covers_requests_active_ <= 0) {
|
||||||
) {
|
|
||||||
if (timer_flush_requests_->isActive()) {
|
if (timer_flush_requests_->isActive()) {
|
||||||
timer_flush_requests_->stop();
|
timer_flush_requests_->stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -421,15 +421,13 @@ void SubsonicRequest::SongsFinishCheck() {
|
|||||||
|
|
||||||
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
|
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
|
||||||
|
|
||||||
if (
|
if (download_album_covers() &&
|
||||||
download_album_covers() &&
|
|
||||||
album_songs_requests_queue_.isEmpty() &&
|
album_songs_requests_queue_.isEmpty() &&
|
||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_cover_requests_queue_.isEmpty() &&
|
album_cover_requests_queue_.isEmpty() &&
|
||||||
album_covers_received_ <= 0 &&
|
album_covers_received_ <= 0 &&
|
||||||
album_covers_requests_sent_.isEmpty() &&
|
album_covers_requests_sent_.isEmpty() &&
|
||||||
album_songs_received_ >= album_songs_requested_
|
album_songs_received_ >= album_songs_requested_) {
|
||||||
) {
|
|
||||||
GetAlbumCovers();
|
GetAlbumCovers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,14 +440,12 @@ QString SubsonicRequest::ParseSong(Song &song, const QJsonObject &json_object, c
|
|||||||
Q_UNUSED(artist_id_requested);
|
Q_UNUSED(artist_id_requested);
|
||||||
Q_UNUSED(album_id_requested);
|
Q_UNUSED(album_id_requested);
|
||||||
|
|
||||||
if (
|
if (!json_object.contains("id"_L1) ||
|
||||||
!json_object.contains("id"_L1) ||
|
|
||||||
!json_object.contains("title"_L1) ||
|
!json_object.contains("title"_L1) ||
|
||||||
!json_object.contains("size"_L1) ||
|
!json_object.contains("size"_L1) ||
|
||||||
!json_object.contains("suffix"_L1) ||
|
!json_object.contains("suffix"_L1) ||
|
||||||
!json_object.contains("duration"_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);
|
Error(u"Invalid Json reply, song is missing one or more values."_s, json_object);
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
@@ -813,8 +809,7 @@ void SubsonicRequest::AlbumCoverFinishCheck() {
|
|||||||
|
|
||||||
void SubsonicRequest::FinishCheck() {
|
void SubsonicRequest::FinishCheck() {
|
||||||
|
|
||||||
if (
|
if (!finished_ &&
|
||||||
!finished_ &&
|
|
||||||
albums_requests_queue_.isEmpty() &&
|
albums_requests_queue_.isEmpty() &&
|
||||||
album_songs_requests_queue_.isEmpty() &&
|
album_songs_requests_queue_.isEmpty() &&
|
||||||
album_cover_requests_queue_.isEmpty() &&
|
album_cover_requests_queue_.isEmpty() &&
|
||||||
@@ -824,8 +819,7 @@ void SubsonicRequest::FinishCheck() {
|
|||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_songs_received_ >= album_songs_requested_ &&
|
album_songs_received_ >= album_songs_requested_ &&
|
||||||
album_covers_requests_active_ <= 0 &&
|
album_covers_requests_active_ <= 0 &&
|
||||||
album_covers_received_ >= album_covers_requested_
|
album_covers_received_ >= album_covers_requested_) {
|
||||||
) {
|
|
||||||
finished_ = true;
|
finished_ = true;
|
||||||
if (no_results_ && songs_.isEmpty()) {
|
if (no_results_ && songs_.isEmpty()) {
|
||||||
Q_EMIT Results(SongMap(), QString());
|
Q_EMIT Results(SongMap(), QString());
|
||||||
|
|||||||
@@ -749,14 +749,12 @@ void TidalRequest::AlbumsFinishCheck(const Artist &artist, const int limit, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (artists_requests_queue_.isEmpty() &&
|
||||||
artists_requests_queue_.isEmpty() &&
|
|
||||||
artists_requests_active_ <= 0 &&
|
artists_requests_active_ <= 0 &&
|
||||||
albums_requests_queue_.isEmpty() &&
|
albums_requests_queue_.isEmpty() &&
|
||||||
albums_requests_active_ <= 0 &&
|
albums_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_queue_.isEmpty() &&
|
artist_albums_requests_queue_.isEmpty() &&
|
||||||
artist_albums_requests_active_ <= 0
|
artist_albums_requests_active_ <= 0) { // Artist albums query is finished, get all songs for all albums.
|
||||||
) { // Artist albums query is finished, get all songs for all albums.
|
|
||||||
|
|
||||||
// Get songs for all the albums.
|
// Get songs for all the albums.
|
||||||
|
|
||||||
@@ -964,8 +962,7 @@ void TidalRequest::SongsFinishCheck(const Artist &artist, const Album &album, co
|
|||||||
|
|
||||||
void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) {
|
void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) {
|
||||||
|
|
||||||
if (
|
if (!json_obj.contains("album"_L1) ||
|
||||||
!json_obj.contains("album"_L1) ||
|
|
||||||
!json_obj.contains("allowStreaming"_L1) ||
|
!json_obj.contains("allowStreaming"_L1) ||
|
||||||
!json_obj.contains("artist"_L1) ||
|
!json_obj.contains("artist"_L1) ||
|
||||||
!json_obj.contains("artists"_L1) ||
|
!json_obj.contains("artists"_L1) ||
|
||||||
@@ -977,8 +974,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti
|
|||||||
!json_obj.contains("trackNumber"_L1) ||
|
!json_obj.contains("trackNumber"_L1) ||
|
||||||
!json_obj.contains("url"_L1) ||
|
!json_obj.contains("url"_L1) ||
|
||||||
!json_obj.contains("volumeNumber"_L1) ||
|
!json_obj.contains("volumeNumber"_L1) ||
|
||||||
!json_obj.contains("copyright"_L1)
|
!json_obj.contains("copyright"_L1)) {
|
||||||
) {
|
|
||||||
Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj);
|
Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1110,8 +1106,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti
|
|||||||
|
|
||||||
void TidalRequest::GetAlbumCoversCheck() {
|
void TidalRequest::GetAlbumCoversCheck() {
|
||||||
|
|
||||||
if (
|
if (!finished_ &&
|
||||||
!finished_ &&
|
|
||||||
service_->download_album_covers() &&
|
service_->download_album_covers() &&
|
||||||
IsQuery() &&
|
IsQuery() &&
|
||||||
artists_requests_queue_.isEmpty() &&
|
artists_requests_queue_.isEmpty() &&
|
||||||
@@ -1128,8 +1123,7 @@ void TidalRequest::GetAlbumCoversCheck() {
|
|||||||
songs_requests_active_ <= 0 &&
|
songs_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_active_ <= 0 &&
|
artist_albums_requests_active_ <= 0 &&
|
||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_covers_requests_active_ <= 0
|
album_covers_requests_active_ <= 0) {
|
||||||
) {
|
|
||||||
GetAlbumCovers();
|
GetAlbumCovers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1274,8 +1268,7 @@ void TidalRequest::AlbumCoverFinishCheck() {
|
|||||||
|
|
||||||
void TidalRequest::FinishCheck() {
|
void TidalRequest::FinishCheck() {
|
||||||
|
|
||||||
if (
|
if (!finished_ &&
|
||||||
!finished_ &&
|
|
||||||
artists_requests_queue_.isEmpty() &&
|
artists_requests_queue_.isEmpty() &&
|
||||||
albums_requests_queue_.isEmpty() &&
|
albums_requests_queue_.isEmpty() &&
|
||||||
songs_requests_queue_.isEmpty() &&
|
songs_requests_queue_.isEmpty() &&
|
||||||
@@ -1290,8 +1283,7 @@ void TidalRequest::FinishCheck() {
|
|||||||
songs_requests_active_ <= 0 &&
|
songs_requests_active_ <= 0 &&
|
||||||
artist_albums_requests_active_ <= 0 &&
|
artist_albums_requests_active_ <= 0 &&
|
||||||
album_songs_requests_active_ <= 0 &&
|
album_songs_requests_active_ <= 0 &&
|
||||||
album_covers_requests_active_ <= 0
|
album_covers_requests_active_ <= 0) {
|
||||||
) {
|
|
||||||
if (timer_flush_requests_->isActive()) {
|
if (timer_flush_requests_->isActive()) {
|
||||||
timer_flush_requests_->stop();
|
timer_flush_requests_->stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,7 @@ namespace Utilities {
|
|||||||
|
|
||||||
QString ColorToRgba(const QColor &c) {
|
QString ColorToRgba(const QColor &c) {
|
||||||
|
|
||||||
return QStringLiteral("rgba(%1, %2, %3, %4)")
|
return QStringLiteral("rgba(%1, %2, %3, %4)").arg(c.red()).arg(c.green()).arg(c.blue()).arg(c.alpha());
|
||||||
.arg(c.red())
|
|
||||||
.arg(c.green())
|
|
||||||
.arg(c.blue())
|
|
||||||
.arg(c.alpha());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ namespace {
|
|||||||
constexpr int TabSize_LargeSidebarMinWidth = 70;
|
constexpr int TabSize_LargeSidebarMinWidth = 70;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
FancyTabBar::FancyTabBar(QWidget *parent) :
|
FancyTabBar::FancyTabBar(QWidget *parent)
|
||||||
QTabBar(parent),
|
: QTabBar(parent),
|
||||||
mouseHoverTabIndex(-1) {
|
mouseHoverTabIndex(-1) {
|
||||||
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ INSTANTIATE_TEST_SUITE_P(RealFiles, SongPlaylistItemTest, testing::Values( // c
|
|||||||
"normalfile.flac",
|
"normalfile.flac",
|
||||||
"file with spaces.flac",
|
"file with spaces.flac",
|
||||||
"file with # hash.flac",
|
"file with # hash.flac",
|
||||||
"file with ? question.flac"
|
"file with ? question.flac"));
|
||||||
));
|
|
||||||
|
|
||||||
TEST_P(SongPlaylistItemTest, Url) {
|
TEST_P(SongPlaylistItemTest, Url) {
|
||||||
QUrl expected;
|
QUrl expected;
|
||||||
@@ -83,4 +82,3 @@ TEST_P(SongPlaylistItemTest, Url) {
|
|||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user