mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
feat: add --unscanned option to files_external:scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
dfcac1057b
commit
3ca5423ca5
1 changed files with 14 additions and 1 deletions
|
|
@ -54,6 +54,11 @@ class Scan extends StorageAuthBase {
|
|||
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();
|
||||
}
|
||||
|
|
@ -84,7 +89,15 @@ class Scan extends StorageAuthBase {
|
|||
});
|
||||
|
||||
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::') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue