diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-10 18:15:23 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-11 13:33:34 +0100 |
commit | 56d10e9054c5f2699e3e0df00bd71a40f53be738 (patch) | |
tree | adb85f5dc08a693d207dca6b461310edfe056a84 /lib | |
parent | 4a130d106c91246c046b1c924a92e674a47b7767 (diff) | |
download | nextcloud-server-56d10e9054c5f2699e3e0df00bd71a40f53be738.tar.gz nextcloud-server-56d10e9054c5f2699e3e0df00bd71a40f53be738.zip |
Cache: simplify scanner logic a bit when handeling with unknown folder sizes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/cache/scanner.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 5a9a119458e..ff37c944240 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -101,18 +101,16 @@ class Scanner { $child = ($path) ? $path . '/' . $file : $file; $data = $this->scanFile($child); if ($data) { - if ($data['mimetype'] === 'httpd/unix-directory') { + if ($data['size'] === -1) { if ($recursive === self::SCAN_RECURSIVE) { $childQueue[] = $child; $data['size'] = 0; } else { - $data['size'] = -1; + $size = -1; } - } else { } - if ($data['size'] === -1) { - $size = -1; - } elseif ($size !== -1) { + + if ($size !== -1) { $size += $data['size']; } } @@ -133,7 +131,7 @@ class Scanner { } return $size; } - + /** * @brief check if the file should be ignored when scanning * NOTE: files with a '.part' extension are ignored as well! @@ -143,8 +141,8 @@ class Scanner { */ private function isIgnoredFile($file) { if ($file === '.' || $file === '..' - || pathinfo($file,PATHINFO_EXTENSION) === 'part') - { + || pathinfo($file, PATHINFO_EXTENSION) === 'part' + ) { return true; } return false; |