From c3aeec8fd2f6b4ad940b143e28796fa1d607e9f2 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sun, 12 Sep 2021 12:32:19 +0200 Subject: [PATCH] LibraryScanner: Add note for cleanUpDatabase() --- src/library/scanner/libraryscanner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/library/scanner/libraryscanner.cpp b/src/library/scanner/libraryscanner.cpp index f75e24c2466..49756cd8839 100644 --- a/src/library/scanner/libraryscanner.cpp +++ b/src/library/scanner/libraryscanner.cpp @@ -45,6 +45,11 @@ void cleanUpDatabase(const QSqlDatabase& database) { << "Cleaning up database..."; PerformanceTimer timer; timer.start(); + // FIXME: The DELETE statement deletes more directory entries than necessary. + // The subselect only covers directories that contain track files. Hashes + // of parent directories that do not contain any track files will be deleted + // and then re-created during the next rescan. This should not really matter + // since the re-calculation of the hash is always required. const auto sqlStmt = QStringLiteral( "DELETE FROM LibraryHashes WHERE hash<>:unequalHash " "AND directory_path NOT IN "