diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-12 14:17:55 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-12 16:15:44 +0100 |
commit | 1a65e3a72593a2eb343386e5008faea78f0b9c8f (patch) | |
tree | 9cb82703e8c275f8f94600c1e1a111c8de2fded8 /lib/private/files/cache | |
parent | 32a703ab3643842d3262fcc8c6ac014c3e54d8ea (diff) | |
download | nextcloud-server-1a65e3a72593a2eb343386e5008faea78f0b9c8f.tar.gz nextcloud-server-1a65e3a72593a2eb343386e5008faea78f0b9c8f.zip |
Now calling parent method when path is not root
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r-- | lib/private/files/cache/homecache.php | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/private/files/cache/homecache.php b/lib/private/files/cache/homecache.php index 4439896e6e7..4b14bd12190 100644 --- a/lib/private/files/cache/homecache.php +++ b/lib/private/files/cache/homecache.php @@ -16,31 +16,23 @@ class HomeCache extends Cache { * @return int */ public function calculateFolderSize($path) { + if ($path !== '/' and $path !== '') { + return parent::calculateFolderSize($path); + } + $totalSize = 0; $entry = $this->get($path); if ($entry && $entry['mimetype'] === 'httpd/unix-directory') { - $isRoot = ($path === '/' or $path === ''); $id = $entry['fileid']; - $sql = 'SELECT SUM(`size`), MIN(`size`) FROM `*PREFIX*filecache` ' . - 'WHERE `parent` = ? AND `storage` = ?'; - if ($isRoot) { - // filter out non-scanned dirs at the root - $sql .= ' AND `size` >= 0'; - } + $sql = 'SELECT SUM(`size`) FROM `*PREFIX*filecache` ' . + 'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { - list($sum, $min) = array_values($row); - $sum = (int)$sum; - $min = (int)$min; - if ($min === -1) { - $totalSize = $min; - } else { - $totalSize = $sum; - } + list($sum) = array_values($row); + $totalSize = (int)$sum; if ($entry['size'] !== $totalSize) { $this->update($id, array('size' => $totalSize)); } - } } return $totalSize; |