Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-12 17:17:55 +0400
committerVincent Petry <pvince81@owncloud.com>2013-11-12 19:15:44 +0400
commit1a65e3a72593a2eb343386e5008faea78f0b9c8f (patch)
tree9cb82703e8c275f8f94600c1e1a111c8de2fded8
parent32a703ab3643842d3262fcc8c6ac014c3e54d8ea (diff)
Now calling parent method when path is not root
-rw-r--r--lib/private/files/cache/homecache.php24
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;