aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-06-02 16:24:30 +0200
committerRobin Appelman <robin@icewind.nl>2025-06-02 16:48:40 +0200
commit6113278d4ca865bfd3c01c9218f2f599e1bf00ae (patch)
treeb193fd7a56592af2fa81c90f3a69cc61566f0cfc
parentbbfd281ac550bbdb8e51722c7fff867dcc350a4e (diff)
downloadnextcloud-server-6113278d4ca865bfd3c01c9218f2f599e1bf00ae.tar.gz
nextcloud-server-6113278d4ca865bfd3c01c9218f2f599e1bf00ae.zip
feat: add --unscanned option to files_external:scanfiles_external-scan-unscanned
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_external/lib/Command/Scan.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php
index 4f29dae1ce0..75d98878baa 100644
--- a/apps/files_external/lib/Command/Scan.php
+++ b/apps/files_external/lib/Command/Scan.php
@@ -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::') {