diff --git a/src/library/dlgtagfetcher.cpp b/src/library/dlgtagfetcher.cpp index b396962a91d..f39816e52e5 100644 --- a/src/library/dlgtagfetcher.cpp +++ b/src/library/dlgtagfetcher.cpp @@ -481,15 +481,15 @@ void DlgTagFetcher::setPercentOfEachRecordings(int totalRecordingsFound) { void DlgTagFetcher::fetchTagFinished( TrackPointer pTrack, - const QList& guessedTrackReleases) { + const QList& guessedTrackReleases, + const QString& whyEmptyMessage) { VERIFY_OR_DEBUG_ASSERT(pTrack == m_pTrack) { return; } m_data.m_tags = guessedTrackReleases; if (guessedTrackReleases.size() == 0) { loadingProgressBar->setValue(kMaximumValueOfQProgressBar); - QString emptyMessage = tr("Could not find this track in the MusicBrainz database."); - loadingProgressBar->setFormat(emptyMessage); + loadingProgressBar->setFormat(whyEmptyMessage); return; } else { btnApply->setDisabled(true); diff --git a/src/library/dlgtagfetcher.h b/src/library/dlgtagfetcher.h index 6c4b9d930fc..f2698e740b6 100644 --- a/src/library/dlgtagfetcher.h +++ b/src/library/dlgtagfetcher.h @@ -41,7 +41,8 @@ class DlgTagFetcher : public QDialog, public Ui::DlgTagFetcher { private slots: void fetchTagFinished( TrackPointer pTrack, - const QList& guessedTrackReleases); + const QList& guessedTrackReleases, + const QString& whyEmptyMessage); void tagSelected(); void showProgressOfConstantTask(const QString&); void setPercentOfEachRecordings(int totalRecordingsFound); diff --git a/src/musicbrainz/tagfetcher.cpp b/src/musicbrainz/tagfetcher.cpp index 7527f5e544a..22871de9909 100644 --- a/src/musicbrainz/tagfetcher.cpp +++ b/src/musicbrainz/tagfetcher.cpp @@ -116,7 +116,8 @@ void TagFetcher::slotFingerprintReady() { if (fingerprint.isEmpty()) { emit resultAvailable( m_pTrack, - QList()); + {}, + tr("Reading track for fingerprinting failed.")); return; } @@ -165,7 +166,8 @@ void TagFetcher::slotAcoustIdTaskSucceeded( emit resultAvailable( std::move(pTrack), - QList()); + {}, + tr("Could not identify track through Acoustid.")); return; } @@ -299,9 +301,15 @@ void TagFetcher::slotMusicBrainzTaskSucceeded( auto pTrack = m_pTrack; terminate(); + QString whyEmptyMessage; + if (guessedTrackReleases.empty()) { + whyEmptyMessage = tr("Could not find this track in the MusicBrainz database."); + } + emit resultAvailable( std::move(pTrack), - std::move(guessedTrackReleases)); + std::move(guessedTrackReleases), + whyEmptyMessage); } void TagFetcher::startFetchCoverArtLinks( diff --git a/src/musicbrainz/tagfetcher.h b/src/musicbrainz/tagfetcher.h index 460776c6519..ac6579dbad4 100644 --- a/src/musicbrainz/tagfetcher.h +++ b/src/musicbrainz/tagfetcher.h @@ -47,7 +47,8 @@ class TagFetcher : public QObject { signals: void resultAvailable( TrackPointer pTrack, - const QList& guessedTrackReleases); + const QList& guessedTrackReleases, + const QString& whyEmptyMessage); // To explain why the result is empty void fetchProgress( const QString& message); void numberOfRecordingsFoundFromAcoustId(int totalNumberOfRecordings);