diff --git a/approot/messages.xml b/approot/messages.xml index d3df21c2..dd550f6e 100644 --- a/approot/messages.xml +++ b/approot/messages.xml @@ -145,7 +145,7 @@ Reconciliating artists: {1} entries... Reloading similarity engine: {1}%... Removing orphaned entries: {1} entries... -Scanning files: {1}/{2} ({3}%)... +Library analysis: {1} files... Step status Updating library fields: {1} entries diff --git a/approot/messages_es.xml b/approot/messages_es.xml index 2811c7bd..9d90a2f6 100644 --- a/approot/messages_es.xml +++ b/approot/messages_es.xml @@ -139,13 +139,12 @@ Comprobando ficheros eliminados... {1}% Compactando la base de datos... Calculando estadísticas... {1}% -Descubriendo ficheros: {1} ficheros Accediendo a las características de la pista desde AcousticBrainz : {1}/{2} ficheros ({3}%)... Optimizando la base de datos... {1}%... Reconciliando artistas: {1} entradas... Recargando el motor de similitud: {1}%... Borrando entradas huérfanas: {1} entradas... -Escaneando ficheros: {1} / {2} ({3}%)... +Análisis de bibliotecas: {1} ficheros... Estado de las etapas Actualizando campos de la biblioteca: {1} entradas diff --git a/approot/messages_fr.xml b/approot/messages_fr.xml index 5f332410..b7c94d7a 100644 --- a/approot/messages_fr.xml +++ b/approot/messages_fr.xml @@ -139,13 +139,12 @@ Vérification des fichiers supprimés... {1}% Compactage de la base de données... Calcul des statistiques... {1}% -Découverte des fichiers : {1} fichiers Récupération des métadonnées AcousticBrainz : {1}/{2} fichiers ({3}%)... Optimisation de la base de données... {1}%... Reconciliation des artistes: {1} entrées... Rechargement du moteur de recommandation : {1}%... Retrait des entrées orphelines: {1} entrées... -Scan des fichiers : {1}/{2} ({3}%)... +Analyse des bibliothèques : {1} fichiers... Statut de l'étape Mise à jour des champs des bibliothèques: {1} entrées diff --git a/approot/messages_it.xml b/approot/messages_it.xml index 00b3d031..30894331 100644 --- a/approot/messages_it.xml +++ b/approot/messages_it.xml @@ -139,13 +139,12 @@ Controllo file... {1}% Compattazione del database... Calcolo statistiche... {1}% -File trovati: {1} files Recupero metadati da AcousticBrainz: {1}/{2} tracce ({3}%)... Ottimizzazione del database... {1}%... Riconciliazione artisti: {1} voci... Ricarica motore di tracce simili: {1}%... Rimozione voci orfane: {1} voci... -Scansione dei file: {1}/{2} ({3}%)... +Analisi delle librerie: {1} file... Stato passo Aggiornamento dei campi della libreria: {1} voci diff --git a/approot/messages_pl.xml b/approot/messages_pl.xml index 8a117a43..5bd2eed0 100644 --- a/approot/messages_pl.xml +++ b/approot/messages_pl.xml @@ -152,17 +152,16 @@ Sprawdzanie plików... {1}% Prasowanie bazy danych... Obliczanie statystyk... {1}% - - Odkrywanie plików: {1} plik - Odkrywanie plików: {1} pliki - Odkrywanie plików: {1} plików - Pobieranie danych o ścieżce z AcousticBrainz: {1}/{2} ścieżek ({3}%)... Optymalizowanie bazy danych... {1}%... Uzgodnianie artystów: {1} wpisów... Przeładowywanie silnika podobieństw: {1}%... Usuwanie osieroconych wpisów: {1} wpisów... -Skanowanie plików: {1}/{2} ({3}%)... + + Analiza bibliotek: {1} plik + Analiza bibliotek: {1} pliki + Analiza bibliotek: {1} plików + Obecny krok Aktualizowanie pól biblioteki: {1} wpisów diff --git a/approot/messages_zh.xml b/approot/messages_zh.xml index 4825aea7..ce6bbebb 100644 --- a/approot/messages_zh.xml +++ b/approot/messages_zh.xml @@ -137,13 +137,12 @@ 检查文件中... {1}% -检索文件中: {1} 文件 从 AcousticBrainz 获取音轨特征: {1}/{2} 音轨 ({3}%)... 重载相似引擎中 {1}%... -扫描文件中: {1}/{2} 个文件 ({3}%)... + 当前步骤状态 diff --git a/src/libs/services/scanner/CMakeLists.txt b/src/libs/services/scanner/CMakeLists.txt index a09c1fbb..3aab7cc5 100644 --- a/src/libs/services/scanner/CMakeLists.txt +++ b/src/libs/services/scanner/CMakeLists.txt @@ -21,7 +21,6 @@ add_library(lmsscanner STATIC impl/steps/ScanStepCheckForRemovedFiles.cpp impl/steps/ScanStepCompact.cpp impl/steps/ScanStepComputeClusterStats.cpp - impl/steps/ScanStepDiscoverFiles.cpp impl/steps/ScanStepOptimize.cpp impl/steps/ScanStepRemoveOrphanedDbEntries.cpp impl/steps/ScanStepScanFiles.cpp diff --git a/src/libs/services/scanner/impl/ScannerService.cpp b/src/libs/services/scanner/impl/ScannerService.cpp index c5a002f0..3bb087ee 100644 --- a/src/libs/services/scanner/impl/ScannerService.cpp +++ b/src/libs/services/scanner/impl/ScannerService.cpp @@ -47,7 +47,6 @@ #include "steps/ScanStepCheckForRemovedFiles.hpp" #include "steps/ScanStepCompact.hpp" #include "steps/ScanStepComputeClusterStats.hpp" -#include "steps/ScanStepDiscoverFiles.hpp" #include "steps/ScanStepOptimize.hpp" #include "steps/ScanStepRemoveOrphanedDbEntries.hpp" #include "steps/ScanStepScanFiles.hpp" @@ -474,7 +473,6 @@ namespace lms::scanner // Order is important: steps are sequential _scanSteps.clear(); - _scanSteps.emplace_back(std::make_unique(params)); _scanSteps.emplace_back(std::make_unique(params)); _scanSteps.emplace_back(std::make_unique(params)); _scanSteps.emplace_back(std::make_unique(params)); diff --git a/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.cpp b/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.cpp deleted file mode 100644 index 61056433..00000000 --- a/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2023 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#include "ScanStepDiscoverFiles.hpp" - -#include "core/ILogger.hpp" -#include "core/Path.hpp" - -#include "MediaLibraryInfo.hpp" -#include "ScannerSettings.hpp" - -#include "ScanContext.hpp" - -namespace lms::scanner -{ - bool ScanStepDiscoverFiles::needProcess([[maybe_unused]] const ScanContext& context) const - { - // always discover files - return true; - } - - void ScanStepDiscoverFiles::process(ScanContext& context) - { - context.stats.totalFileCount = 0; - - for (const MediaLibraryInfo& mediaLibrary : _settings.mediaLibraries) - { - std::size_t currentDirectoryProcessElemsCount{}; - core::pathUtils::exploreFilesRecursive( - mediaLibrary.rootDirectory, [&](std::error_code ec, const std::filesystem::path& path) { - if (_abortScan) - return false; - - // we don't report errors here (done in the actual scan step) - if (!ec && selectFileScanner(path)) - { - context.currentStepStats.processedElems++; - currentDirectoryProcessElemsCount++; - _progressCallback(context.currentStepStats); - } - - return true; - }, - &excludeDirFileName); - - LMS_LOG(DBUPDATER, DEBUG, "Discovered " << currentDirectoryProcessElemsCount << " files in " << mediaLibrary.rootDirectory); - } - - context.stats.totalFileCount = context.currentStepStats.processedElems; - - LMS_LOG(DBUPDATER, DEBUG, "Discovered " << context.stats.totalFileCount << " files in all directories"); - } -} // namespace lms::scanner diff --git a/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.hpp b/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.hpp deleted file mode 100644 index ab8baeff..00000000 --- a/src/libs/services/scanner/impl/steps/ScanStepDiscoverFiles.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2023 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#pragma once - -#include "ScanStepBase.hpp" - -namespace lms::scanner -{ - class ScanStepDiscoverFiles : public ScanStepBase - { - public: - using ScanStepBase::ScanStepBase; - - private: - ScanStep getStep() const override { return ScanStep::DiscoverFiles; } - core::LiteralString getStepName() const override { return "Discover files"; } - bool needProcess(const ScanContext& context) const override; - void process(ScanContext& context) override; - }; -} // namespace lms::scanner diff --git a/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp b/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp index 27f13d50..19c4ed85 100644 --- a/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp +++ b/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp @@ -107,8 +107,6 @@ namespace lms::scanner void ScanStepScanFiles::process(ScanContext& context) { - context.currentStepStats.totalElems = context.stats.totalFileCount; - for (const MediaLibraryInfo& mediaLibrary : _settings.mediaLibraries) process(context, mediaLibrary); } @@ -165,6 +163,8 @@ namespace lms::scanner return true; }, &excludeDirFileName); + + context.stats.totalFileCount = context.currentStepStats.totalElems; } void ScanStepScanFiles::processFileScanResults(ScanContext& context, std::span> scanJobs) diff --git a/src/libs/services/scanner/include/services/scanner/ScannerStats.hpp b/src/libs/services/scanner/include/services/scanner/ScannerStats.hpp index 2de12172..7d1633df 100644 --- a/src/libs/services/scanner/include/services/scanner/ScannerStats.hpp +++ b/src/libs/services/scanner/include/services/scanner/ScannerStats.hpp @@ -54,7 +54,6 @@ namespace lms::scanner CheckForRemovedFiles, ComputeClusterStats, Compact, - DiscoverFiles, FetchTrackFeatures, Optimize, ReconciliateArtists, @@ -84,7 +83,7 @@ namespace lms::scanner Wt::WDateTime startTime; Wt::WDateTime stopTime; - std::size_t totalFileCount{}; // Total number of files (estimated) + std::size_t totalFileCount{}; // Total number of files (only valid after the file scan step) std::size_t skips{}; // no change since last scan std::size_t scans{}; // count of scanned files diff --git a/src/lms/ui/admin/ScannerController.cpp b/src/lms/ui/admin/ScannerController.cpp index 2f3e196e..5931b8a9 100644 --- a/src/lms/ui/admin/ScannerController.cpp +++ b/src/lms/ui/admin/ScannerController.cpp @@ -212,11 +212,6 @@ namespace lms::ui .arg(stepStats.progress())); break; - case ScanStep::DiscoverFiles: - _stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-discovering-files") - .arg(stepStats.processedElems)); - break; - case ScanStep::FetchTrackFeatures: _stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-fetching-track-features") .arg(stepStats.processedElems) @@ -246,9 +241,7 @@ namespace lms::ui case ScanStep::ScanFiles: _stepStatus->setText(Wt::WString::tr("Lms.Admin.ScannerController.step-scanning-files") - .arg(stepStats.processedElems) - .arg(stepStats.totalElems) - .arg(stepStats.progress())); + .arg(stepStats.processedElems)); break; case ScanStep::UpdateLibraryFields: