Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: add --unscanned option to files_external:scan
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Jun 2, 2025
commit 6113278d4ca865bfd3c01c9218f2f599e1bf00ae
15 changes: 14 additions & 1 deletion apps/files_external/lib/Command/Scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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();
}
Expand Down Expand Up @@ -84,7 +89,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
});

try {
$scanner->scan($path);
if ($input->getOption('unscanned')) {
if ($path !== '') {
$output->writeln('<error>--unscanned is mutually exclusive with --path</error>');
return 1;
}
$scanner->backgroundScan();
} else {
$scanner->scan($path);
}
} catch (LockedException $e) {
if (is_string($e->getReadablePath()) && str_starts_with($e->getReadablePath(), 'scanner::')) {
if ($e->getReadablePath() === 'scanner::') {
Expand Down
Loading