Skip to content

Commit

Permalink
Fixed counter in the scanner's discovery step
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Nov 5, 2024
1 parent 908ef16 commit b25f4f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libs/services/scanner/impl/ScanStepDiscoverFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ namespace lms::scanner
{
context.stats.totalFileCount = 0;

std::vector<std::filesystem::path> supportedExtensions;
for (const auto& extension : _settings.supportedAudioFileExtensions)
supportedExtensions.emplace_back(extension);
for (const auto& extension : _settings.supportedImageFileExtensions)
supportedExtensions.emplace_back(extension);
for (const auto& extension : _settings.supportedLyricsFileExtensions)
supportedExtensions.emplace_back(extension);

for (const ScannerSettings::MediaLibraryInfo& mediaLibrary : _settings.mediaLibraries)
{
std::size_t currentDirectoryProcessElemsCount{};
Expand All @@ -36,7 +44,7 @@ namespace lms::scanner
if (_abortScan)
return false;

if (!ec && (core::pathUtils::hasFileAnyExtension(path, _settings.supportedAudioFileExtensions) || core::pathUtils::hasFileAnyExtension(path, _settings.supportedImageFileExtensions)))
if (!ec && core::pathUtils::hasFileAnyExtension(path, supportedExtensions))
{
context.currentStepStats.processedElems++;
currentDirectoryProcessElemsCount++;
Expand Down

0 comments on commit b25f4f2

Please sign in to comment.