Skip to content

Commit

Permalink
Merge pull request #4280 from uklotzde/cleanUpDatabase
Browse files Browse the repository at this point in the history
LibraryScanner: Add note for cleanUpDatabase()
  • Loading branch information
Holzhaus authored Sep 12, 2021
2 parents 989f7c8 + c3aeec8 commit 69ac6fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/library/scanner/libraryscanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 69ac6fe

Please sign in to comment.