|
7 | 7 | namespace OCA\Files_Sharing; |
8 | 8 |
|
9 | 9 | use OC\Files\Cache\CacheDependencies; |
| 10 | +use OC\Files\Cache\CacheEntry; |
10 | 11 | use OC\Files\Cache\FailedCache; |
11 | 12 | use OC\Files\Cache\NullWatcher; |
12 | 13 | use OC\Files\Cache\Watcher; |
|
17 | 18 | use OC\Files\Storage\Wrapper\PermissionsMask; |
18 | 19 | use OC\Files\Storage\Wrapper\Wrapper; |
19 | 20 | use OC\User\NoUserException; |
20 | | -use OCA\Files_External\Config\ConfigAdapter; |
21 | 21 | use OCA\Files_Sharing\ISharedStorage as LegacyISharedStorage; |
22 | 22 | use OCP\Constants; |
23 | 23 | use OCP\Files\Cache\ICacheEntry; |
24 | | -use OCP\Files\Config\IUserMountCache; |
25 | 24 | use OCP\Files\Folder; |
26 | 25 | use OCP\Files\IHomeStorage; |
27 | 26 | use OCP\Files\IRootFolder; |
@@ -456,17 +455,13 @@ public function getWatcher($path = '', $storage = null): Watcher { |
456 | 455 |
|
457 | 456 | // Get node information |
458 | 457 | $node = $this->getShare()->getNodeCacheEntry(); |
459 | | - if ($node) { |
460 | | - /** @var IUserMountCache $userMountCache */ |
461 | | - $userMountCache = \OC::$server->get(IUserMountCache::class); |
462 | | - $mounts = $userMountCache->getMountsForStorageId($node->getStorageId()); |
463 | | - foreach ($mounts as $mount) { |
464 | | - // If the share is originating from an external storage |
465 | | - if ($mount->getMountProvider() === ConfigAdapter::class) { |
466 | | - // Propagate original storage scan |
467 | | - $this->watcher = parent::getWatcher($path, $storage); |
468 | | - return $this->watcher; |
469 | | - } |
| 458 | + if ($node instanceof CacheEntry) { |
| 459 | + $storageId = $node->getData()['storage_string_id']; |
| 460 | + // for shares from the home storage we can rely on the home storage to keep itself up to date |
| 461 | + // for other storages we need use the proper watcher |
| 462 | + if (!(str_starts_with($storageId, 'home::') || str_starts_with($storageId, 'object::user'))) { |
| 463 | + $this->watcher = parent::getWatcher($path, $storage); |
| 464 | + return $this->watcher; |
470 | 465 | } |
471 | 466 | } |
472 | 467 |
|
|
0 commit comments