diff options
Diffstat (limited to 'lib/private/files/cache/cache.php')
-rw-r--r-- | lib/private/files/cache/cache.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 9b18257088c..d886fd0fe76 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -498,9 +498,10 @@ class Cache { * update the folder size and the size of all parent folders * * @param string|boolean $path + * @param array $data (optional) meta data of the folder */ - public function correctFolderSize($path) { - $this->calculateFolderSize($path); + public function correctFolderSize($path, $data = null) { + $this->calculateFolderSize($path, $data); if ($path !== '') { $parent = dirname($path); if ($parent === '.' or $parent === '/') { @@ -514,11 +515,14 @@ class Cache { * get the size of a folder and set it in the cache * * @param string $path + * @param array $entry (optional) meta data of the folder * @return int */ - public function calculateFolderSize($path) { + public function calculateFolderSize($path, $entry = null) { $totalSize = 0; - $entry = $this->get($path); + if (is_null($entry)) { + $entry = $this->get($path); + } if ($entry && $entry['mimetype'] === 'httpd/unix-directory') { $id = $entry['fileid']; $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2, ' . |