Made the step 'check for removed files' faster when nothing was actually removed
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user