summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-06-04 18:19:48 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-04 18:19:48 +0200
commita2db53b928f7b0202391fca3c1d746478be9acae (patch)
treebb553df06df4e77b18eca6378fdbc5ee1a42f873 /apps/files_trashbin
parente734caecba15a317428aea4d308b2ff377f0c19b (diff)
parent8ee15025f06b683673101c5604b10798c75a76ae (diff)
downloadnextcloud-server-a2db53b928f7b0202391fca3c1d746478be9acae.tar.gz
nextcloud-server-a2db53b928f7b0202391fca3c1d746478be9acae.zip
Merge pull request #8471 from owncloud/versioning_no_longer_track_the_size
[versioning] let the file cache track the size of the versions
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/appinfo/update.php3
-rw-r--r--apps/files_trashbin/lib/trashbin.php4
2 files changed, 3 insertions, 4 deletions
diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php
index ca7b87a8681..191d3cf25d9 100644
--- a/apps/files_trashbin/appinfo/update.php
+++ b/apps/files_trashbin/appinfo/update.php
@@ -5,6 +5,5 @@ $installedVersion=OCP\Config::getAppValue('files_trashbin', 'installed_version')
if (version_compare($installedVersion, '0.6', '<')) {
//size of the trash bin could be incorrect, remove it for all users to
//enforce a recalculation during next usage.
- $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trashsize`');
- $result = $query->execute();
+ \OC_DB::dropTable('files_trashsize');
}
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index fb23b516208..a8e66b06bbd 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -905,12 +905,12 @@ class Trashbin {
* get current size of trash bin from a given user
*
* @param string $user user who owns the trash bin
- * @return mixed trash bin size or false if no trash bin size is stored
+ * @return integer trash bin size
*/
private static function getTrashbinSize($user) {
$view = new \OC\Files\View('/' . $user);
$fileInfo = $view->getFileInfo('/files_trashbin');
- return $fileInfo['size'];
+ return isset($fileInfo['size']) ? $fileInfo['size'] : 0;
}
/**