Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-08-16 16:58:27 +0300
committerCarl Schwan <carl@carlschwan.eu>2021-08-17 10:55:04 +0300
commitf9b7f631f7c2911a1c8bedcfe27fe5746f3a8151 (patch)
tree1fc68872057cbb140b5a0f6556a9b4c64f8baa85
parent412132e8a5ddf84597c714f75f3bf9d8eeabceff (diff)
Correctly calculate directory sizes when using an object store primary storage
A object store storage should use an NoopScanner since it is not possible to scan the directory structure of an object store. This makes sure that the group folder mount point doesn't override the NoopScanner that the object store storage use. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--lib/Mount/GroupFolderStorage.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Mount/GroupFolderStorage.php b/lib/Mount/GroupFolderStorage.php
index de264cad..7e483da1 100644
--- a/lib/Mount/GroupFolderStorage.php
+++ b/lib/Mount/GroupFolderStorage.php
@@ -23,6 +23,8 @@ namespace OCA\GroupFolders\Mount;
use OC\Files\Cache\Scanner;
+use OC\Files\ObjectStore\NoopScanner;
+use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\Storage\Wrapper\Quota;
use OCP\Files\Cache\ICacheEntry;
use OCP\IUser;
@@ -86,7 +88,9 @@ class GroupFolderStorage extends Quota {
if (!$storage) {
$storage = $this;
}
- if (!isset($storage->scanner)) {
+ if ($storage->instanceOfStorage(ObjectStoreStorage::class)) {
+ $storage->scanner = new NoopScanner($storage);
+ } else if (!isset($storage->scanner)) {
$storage->scanner = new Scanner($storage);
}
return $storage->scanner;