diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php index 575ee5989f543..1b0c7c8697ede 100644 --- a/apps/files_external/lib/Command/Scan.php +++ b/apps/files_external/lib/Command/Scan.php @@ -53,6 +53,11 @@ protected function configure(): void { InputOption::VALUE_OPTIONAL, 'The path in the storage to scan', '' + )->addOption( + 'unscanned', + '', + InputOption::VALUE_NONE, + 'only scan files which are marked as not fully scanned' ); parent::configure(); } @@ -82,7 +87,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->abortIfInterrupted(); }); - $scanner->scan($path); + if ($input->getOption('unscanned')) { + if ($path !== '') { + $output->writeln('--unscanned is mutually exclusive with --path'); + return 1; + } + $scanner->backgroundScan(); + } else { + $scanner->scan($path); + } $this->presentStats($output);