Skip to content

Commit ef17b4e

Browse files
authored
Merge pull request #53294 from nextcloud/backport/53264/stable30
[stable30] feat: add --unscanned option to files_external:scan
2 parents 3ee7db1 + 96fad4d commit ef17b4e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

apps/files_external/lib/Command/Scan.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ protected function configure(): void {
5353
InputOption::VALUE_OPTIONAL,
5454
'The path in the storage to scan',
5555
''
56+
)->addOption(
57+
'unscanned',
58+
'',
59+
InputOption::VALUE_NONE,
60+
'only scan files which are marked as not fully scanned'
5661
);
5762
parent::configure();
5863
}
@@ -82,7 +87,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8287
$this->abortIfInterrupted();
8388
});
8489

85-
$scanner->scan($path);
90+
if ($input->getOption('unscanned')) {
91+
if ($path !== '') {
92+
$output->writeln('<error>--unscanned is mutually exclusive with --path</error>');
93+
return 1;
94+
}
95+
$scanner->backgroundScan();
96+
} else {
97+
$scanner->scan($path);
98+
}
8699

87100
$this->presentStats($output);
88101

0 commit comments

Comments
 (0)