Skip to content

Commit 6113278

Browse files
committed
feat: add --unscanned option to files_external:scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent bbfd281 commit 6113278

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
@@ -54,6 +54,11 @@ protected function configure(): void {
5454
InputOption::VALUE_OPTIONAL,
5555
'The path in the storage to scan',
5656
''
57+
)->addOption(
58+
'unscanned',
59+
'',
60+
InputOption::VALUE_NONE,
61+
'only scan files which are marked as not fully scanned'
5762
);
5863
parent::configure();
5964
}
@@ -84,7 +89,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8489
});
8590

8691
try {
87-
$scanner->scan($path);
92+
if ($input->getOption('unscanned')) {
93+
if ($path !== '') {
94+
$output->writeln('<error>--unscanned is mutually exclusive with --path</error>');
95+
return 1;
96+
}
97+
$scanner->backgroundScan();
98+
} else {
99+
$scanner->scan($path);
100+
}
88101
} catch (LockedException $e) {
89102
if (is_string($e->getReadablePath()) && str_starts_with($e->getReadablePath(), 'scanner::')) {
90103
if ($e->getReadablePath() === 'scanner::') {

0 commit comments

Comments
 (0)