@@ -405,6 +405,7 @@ public function getFirstNodeByIdInPath(int $id, string $path): ?INode {
405405 */
406406 public function getByIdInPath (int $ id , string $ path ): array {
407407 $ mountCache = $ this ->getUserMountCache ();
408+ $ setupManager = $ this ->mountManager ->getSetupManager ();
408409 if ($ path !== '' && strpos ($ path , '/ ' , 1 ) > 0 ) {
409410 [, $ user ] = explode ('/ ' , $ path );
410411 } else {
@@ -414,7 +415,7 @@ public function getByIdInPath(int $id, string $path): array {
414415
415416 // if the mount isn't in the cache yet, perform a setup first, then try again
416417 if (count ($ mountsContainingFile ) === 0 ) {
417- $ this -> mountManager -> getSetupManager () ->setupForPath ($ path , true );
418+ $ setupManager ->setupForPath ($ path , true );
418419 $ mountsContainingFile = $ mountCache ->getMountsForFileId ($ id , $ user );
419420 }
420421
@@ -436,11 +437,7 @@ public function getByIdInPath(int $id, string $path): array {
436437 }, $ mountsContainingFile ));
437438 $ mountRoots = array_combine ($ mountRootIds , $ mountRootPaths );
438439
439- $ mounts = $ this ->mountManager ->getMountsByMountProvider ($ path , $ mountProviders );
440-
441- $ mountsContainingFile = array_filter ($ mounts , function ($ mount ) use ($ mountRoots ) {
442- return isset ($ mountRoots [$ mount ->getStorageRootId ()]);
443- });
440+ $ mountsContainingFile = array_filter (array_map ($ this ->mountManager ->getMountFromMountInfo (...), $ mountsContainingFile ));
444441
445442 if (count ($ mountsContainingFile ) === 0 ) {
446443 if ($ user === $ this ->getAppDataDirectoryName ()) {
0 commit comments