Merge pull request #53293 from nextcloud/backport/53264/stable31

[stable31] feat: add --unscanned option to files_external:scan
This commit is contained in:
Robin Appelman 2025-06-03 19:31:24 +02:00 committed by GitHub
commit 706f450967
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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::') {