summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-03 11:55:35 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-03 19:54:59 +0200
commita6bb1e1bf8bcea9c4ad4e13e73f397efcc6fc27b (patch)
tree61983b7d929536797a61a3de5804b24a71ca1b7a /lib
parentf297bf14f9c91cc6d3e4a6df340b4bc24d85c2a7 (diff)
downloadnextcloud-server-a6bb1e1bf8bcea9c4ad4e13e73f397efcc6fc27b.tar.gz
nextcloud-server-a6bb1e1bf8bcea9c4ad4e13e73f397efcc6fc27b.zip
Fix size calculation during recursive scan
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/scanner.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 5a71bd26e89..6cb9807f5a7 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -174,7 +174,6 @@ class Scanner extends BasicEmitter {
* @return int the id of the added file
*/
protected function addToCache($path, $data) {
- echo "add";
\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
$this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
if ($this->cacheActive) {
@@ -250,11 +249,8 @@ class Scanner extends BasicEmitter {
if ($data) {
if ($data['mimetype'] === 'httpd/unix-directory' and $recursive === self::SCAN_RECURSIVE) {
$childQueue[] = $child;
- }
- if ($data['size'] === -1) {
- if ($recursive !== self::SCAN_RECURSIVE) {
- $size = -1;
- }
+ } else if ($data['size'] === -1) {
+ $size = -1;
} else if ($size !== -1) {
$size += $data['size'];
}
@@ -287,7 +283,7 @@ class Scanner extends BasicEmitter {
$childSize = $this->scanChildren($child, self::SCAN_RECURSIVE, $reuse);
if ($childSize === -1) {
$size = -1;
- } else {
+ } else if ($size !== -1) {
$size += $childSize;
}
}