Skip to content

Commit 71c2456

Browse files
authored
Return proper watcher if SharedStorage originates from ExternalMount
1 parent a83f42c commit 71c2456

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

apps/files_sharing/lib/SharedStorage.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,20 @@ public function getOwner($path) {
402402
return $this->superShare->getShareOwner();
403403
}
404404

405-
public function getWatcher($path = '', $storage = null) {
405+
public function getWatcher($path = '', $storage = null): Watcher {
406+
$mountManager = \OC::$server->getMountManager();
407+
408+
// Get node informations
409+
$node = $this->getShare()->getNodeCacheEntry();
410+
if ($node) {
411+
$mount = $mountManager->findByNumericId($node->getStorageId());
412+
// If the share is originating from an external storage
413+
if (count($mount) > 0 && $mount[0] instanceof ExternalMountPoint) {
414+
// Propagate original storage scan
415+
return parent::getWatcher($path, $storage);
416+
}
417+
}
418+
406419
// cache updating is handled by the share source
407420
return new NullWatcher();
408421
}

0 commit comments

Comments
 (0)