[Pkg-owncloud-commits] [owncloud] 62/134: Propagate unencrypted_size up to the file cache root

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 21:44:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a70b99ff62e85208144dc06bb19737c0b602bf4f
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Mar 7 11:00:22 2014 +0100

    Propagate unencrypted_size up to the file cache root
---
 lib/private/files/cache/homecache.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/private/files/cache/homecache.php b/lib/private/files/cache/homecache.php
index 71bb944..f6cbca1 100644
--- a/lib/private/files/cache/homecache.php
+++ b/lib/private/files/cache/homecache.php
@@ -24,15 +24,20 @@ class HomeCache extends Cache {
 		$entry = $this->get($path);
 		if ($entry && $entry['mimetype'] === 'httpd/unix-directory') {
 			$id = $entry['fileid'];
-			$sql = 'SELECT SUM(`size`) FROM `*PREFIX*filecache` ' .
+			$sql = 'SELECT SUM(`size`) AS f1, ' .
+			   'SUM(`unencrypted_size`) AS f2 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) = array_values($row);
+				list($sum, $unencryptedSum) = array_values($row);
 				$totalSize = (int)$sum;
+				$unencryptedSize = (int)$unencryptedSum;
 				if ($entry['size'] !== $totalSize) {
 					$this->update($id, array('size' => $totalSize));
 				}
+				if ($entry['unencrypted_size'] !== $unencryptedSize) {
+					$this->update($id, array('unencrypted_size' => $unencryptedSize));
+				}
 			}
 		}
 		return $totalSize;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list