aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/View.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r--lib/private/Files/View.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index f79a992c773..456f804ee56 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1412,11 +1412,7 @@ class View {
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
//add the sizes of other mount points to the folder
$extOnly = ($includeMountPoints === 'ext');
- $mounts = Filesystem::getMountManager()->findIn($path);
- $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) {
- $subStorage = $mount->getStorage();
- return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage);
- }));
+ $this->addSubMounts($info, $extOnly);
}
}
@@ -1429,6 +1425,17 @@ class View {
}
/**
+ * Extend a FileInfo that was previously requested with `$includeMountPoints = false` to include the sub mounts
+ */
+ public function addSubMounts(FileInfo $info, $extOnly = false): void {
+ $mounts = Filesystem::getMountManager()->findIn($info->getPath());
+ $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) {
+ $subStorage = $mount->getStorage();
+ return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage);
+ }));
+ }
+
+ /**
* get the content of a directory
*
* @param string $directory path under datadirectory