Skip to content

Commit 6e1c112

Browse files
committed
Ignore root of groupfolders from autotagging
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent e0c0f2d commit 6e1c112

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Operation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ public function validateOperation($name, array $checks, $operation) {
9999
}
100100

101101
public function isTaggingPath(IStorage $storage, string $file): bool {
102+
if (substr_count($file, '/') === 0) {
103+
return false;
104+
}
102105
if ($storage->instanceOfStorage(IHomeStorage::class)) {
103-
if (substr_count($file, '/') === 0) {
104-
return false;
105-
}
106106
list($folder) = explode('/', $file, 2);
107107
return $folder === 'files';
108108
} else {
109-
list($folder) = explode('/', $file, 2);
109+
[$folder, $subPath] = explode('/', $file, 2);
110110
// the root folder only contains appdata and home mounts
111111
// anything in a non homestorage and not in the appdata folder
112112
// should be a mounted folder
113-
return $folder !== $this->getAppDataFolderName();
113+
return $folder !== $this->getAppDataFolderName() && ($folder !== '__groupfolders' || substr_count($subPath, '/') >= 1);
114114
}
115115
}
116116

0 commit comments

Comments
 (0)