Made the step 'check for removed files' faster when nothing was actually removed

This commit is contained in:
emeric
2025-07-18 18:39:50 +02:00
parent aa23350f56
commit f31d366731
12 changed files with 329 additions and 152 deletions
@@ -31,6 +31,7 @@
#include "scanners/IFileScanOperation.hpp"
#include "scanners/IFileScanner.hpp"
#include "FileScanners.hpp"
#include "JobQueue.hpp"
#include "ScanContext.hpp"
@@ -68,18 +69,6 @@ namespace lms::scanner
};
} // namespace
ScanStepScanFiles::ScanStepScanFiles(InitParams& initParams)
: ScanStepBase{ initParams }
{
visitFileScanners([](IFileScanner* scanner) {
for (const std::filesystem::path& file : scanner->getSupportedFiles())
LMS_LOG(DBUPDATER, INFO, scanner->getName() << ": supporting file " << file);
for (const std::filesystem::path& extension : scanner->getSupportedExtensions())
LMS_LOG(DBUPDATER, INFO, scanner->getName() << ": supporting file extension " << extension);
});
}
bool ScanStepScanFiles::needProcess([[maybe_unused]] const ScanContext& context) const
{
// Always need to scan files
@@ -122,7 +111,7 @@ namespace lms::scanner
addError<IOScanError>(context, path, ec);
context.stats.skips++;
}
else if (IFileScanner * scanner{ selectFileScanner(path) })
else if (IFileScanner * scanner{ getFileScanners().select(path) })
{
FileToScan fileToScan;