Skip to content

Commit

Permalink
Merge pull request #11420 from ronso0/track-file-location-debug
Browse files Browse the repository at this point in the history
debug: omit 'QFileInfo()' when printing track file locations
  • Loading branch information
Swiftb0y authored Mar 30, 2023
2 parents 4f45f22 + ba7dd92 commit 86539e0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/analyzer/analyzerthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ void AnalyzerThread::doRun() {

while (awaitWorkItemsFetched()) {
DEBUG_ASSERT(m_currentTrack);
kLogger.debug() << "Analyzing" << m_currentTrack->getFileInfo();
kLogger.debug() << "Analyzing" << m_currentTrack->getLocation();

// Get the audio
const auto audioSource =
SoundSourceProxy(m_currentTrack).openAudioSource(openParams);
if (!audioSource) {
kLogger.warning()
<< "Failed to open file for analyzing:"
<< m_currentTrack->getFileInfo();
<< m_currentTrack->getLocation();
emitDoneProgress(kAnalyzerProgressUnknown);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/autodj/autodjfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void AutoDJFeature::slotAddRandomTrack() {
if (!pRandomTrack->checkFileExists()) {
qWarning() << "Track does not exist:"
<< pRandomTrack->getInfo()
<< pRandomTrack->getFileInfo();
<< pRandomTrack->getLocation();
pRandomTrack.reset();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/basetrackcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ bool BaseTrackCache::updateTrackInIndex(
return false;
}
if (sDebug) {
qDebug() << "updateTrackInIndex:" << pTrack->getFileInfo();
qDebug() << "updateTrackInIndex:" << pTrack->getLocation();
}

int numColumns = columnCount();
Expand Down
30 changes: 15 additions & 15 deletions src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ void TrackDAO::saveTrack(Track* pTrack) const {
return;
}
qDebug() << "TrackDAO: Saving track"
<< trackId
<< pTrack->getFileInfo();
<< trackId
<< pTrack->getLocation();
if (updateTrack(pTrack)) {
// BaseTrackCache must be informed separately, because the
// track has already been disconnected and TrackDAO does
Expand Down Expand Up @@ -534,13 +534,13 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) {
VERIFY_OR_DEBUG_ASSERT(m_pQueryLibraryInsert || m_pQueryTrackLocationInsert ||
m_pQueryLibrarySelect || m_pQueryTrackLocationSelect) {
qDebug() << "TrackDAO::addTracksAddTrack: needed SqlQuerys have not "
"been prepared. Skipping track"
<< pTrack->getFileInfo();
"been prepared. Skipping track"
<< pTrack->getLocation();
return TrackId();
}

qDebug() << "TrackDAO: Adding track"
<< pTrack->getFileInfo();
<< pTrack->getLocation();

TrackId trackId;

Expand Down Expand Up @@ -572,10 +572,10 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) {

m_pQueryLibrarySelect->bindValue(":location", trackLocationId.toVariant());
if (!m_pQueryLibrarySelect->exec()) {
LOG_FAILED_QUERY(*m_pQueryLibrarySelect)
<< "Failed to query existing track: "
<< pTrack->getFileInfo();
return TrackId();
LOG_FAILED_QUERY(*m_pQueryLibrarySelect)
<< "Failed to query existing track: "
<< pTrack->getLocation();
return TrackId();
}
if (m_queryLibraryIdColumn == UndefinedRecordIndex) {
QSqlRecord queryLibraryRecord = m_pQueryLibrarySelect->record();
Expand All @@ -601,7 +601,7 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) {
if (!m_pQueryLibraryUpdate->exec()) {
LOG_FAILED_QUERY(*m_pQueryLibraryUpdate)
<< "Failed to unremove existing track: "
<< pTrack->getFileInfo();
<< pTrack->getLocation();
return TrackId();
}
}
Expand Down Expand Up @@ -716,8 +716,8 @@ TrackPointer TrackDAO::addTracksAddFile(const TrackFile& trackFile, bool unremov
const TrackId newTrackId = addTracksAddTrack(pTrack, unremove);
if (!newTrackId.isValid()) {
qWarning() << "TrackDAO::addTracksAddTrack:"
<< "Failed to add track to database"
<< pTrack->getFileInfo();
<< "Failed to add track to database"
<< pTrack->getLocation();
// GlobalTrackCache will be unlocked implicitly
return TrackPointer();
}
Expand Down Expand Up @@ -1418,9 +1418,9 @@ bool TrackDAO::updateTrack(Track* pTrack) const {
DEBUG_ASSERT(trackId.isValid());

qDebug() << "TrackDAO:"
<< "Updating track in database"
<< trackId
<< pTrack->getFileInfo();
<< "Updating track in database"
<< trackId
<< pTrack->getLocation();

SqlTransaction transaction(m_database);
// PerformanceTimer time;
Expand Down
2 changes: 1 addition & 1 deletion src/musicbrainz/chromaprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ QString ChromaPrinter::getFingerprint(TrackPointer pTrack) {
if (!pAudioSource) {
qDebug()
<< "Failed to open file for fingerprinting"
<< pTrack->getFileInfo();
<< pTrack->getLocation();
return QString();
}

Expand Down
2 changes: 1 addition & 1 deletion src/sources/soundsourceproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ void SoundSourceProxy::updateTrackFromSource(
<< "Parsing missing"
<< (splitArtistTitle ? "artist/title" : "title")
<< "from file name:"
<< trackFile;
<< trackFile.location();
if (trackMetadata.refTrackInfo().parseArtistTitleFromFileName(
trackFile.fileName(), splitArtistTitle)) {
// Pretend that metadata import succeeded
Expand Down

0 comments on commit 86539e0

Please sign in to comment.