From a0a877e3c100231dc13a2f5a28017ab92d1bc06a Mon Sep 17 00:00:00 2001 From: emeric Date: Mon, 16 Sep 2024 22:19:33 +0200 Subject: [PATCH] Added some debug logs to help spot heterogeneous artist names for same MBIDq, ref #491 --- src/libs/services/scanner/impl/ScanStepScanFiles.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libs/services/scanner/impl/ScanStepScanFiles.cpp b/src/libs/services/scanner/impl/ScanStepScanFiles.cpp index 99b10ce1..eca422df 100644 --- a/src/libs/services/scanner/impl/ScanStepScanFiles.cpp +++ b/src/libs/services/scanner/impl/ScanStepScanFiles.cpp @@ -134,17 +134,25 @@ namespace lms::scanner return artist; } + std::string optionalMBIDAsString(const std::optional& uuid) + { + return uuid ? std::string{ uuid->getAsString() } : ""; + } + void updateArtistIfNeeded(Artist::pointer artist, const metadata::Artist& artistInfo) { // Name may have been updated if (artist->getName() != artistInfo.name) { + LMS_LOG(DBUPDATER, DEBUG, "Artist [" << optionalMBIDAsString(artist->getMBID()) << "], updated name from '" << artist->getName() << "' to '" << artistInfo.name << "'"); artist.modify()->setName(artistInfo.name); } // Sortname may have been updated + // As the sort name is quite often not filled in, we update it only if already set (for now?) if (artistInfo.sortName && *artistInfo.sortName != artist->getSortName()) { + LMS_LOG(DBUPDATER, DEBUG, "Artist [" << optionalMBIDAsString(artist->getMBID()) << "], updated sort name from '" << artist->getSortName() << "' to '" << *artistInfo.sortName << "'"); artist.modify()->setSortName(*artistInfo.sortName); } }