aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-01-27 15:56:57 +0100
committerRobin Appelman <icewind@owncloud.com>2014-01-27 15:56:57 +0100
commit3c1ab66edac1ba2f1b398c859cd933c410ea3d8d (patch)
treebdd26dd256e1668751dde67d848ac4ab2a191c11 /apps/files/lib
parentd182b4f59fd7b172764a4d802dbd3ee6a953ea39 (diff)
downloadnextcloud-server-3c1ab66edac1ba2f1b398c859cd933c410ea3d8d.tar.gz
nextcloud-server-3c1ab66edac1ba2f1b398c859cd933c410ea3d8d.zip
Reuse the calculated free_space in buildFileStorageStatistics
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/helper.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php
index eaff28178ea..87939d26921 100644
--- a/apps/files/lib/helper.php
+++ b/apps/files/lib/helper.php
@@ -5,14 +5,14 @@ namespace OCA\Files;
class Helper
{
public static function buildFileStorageStatistics($dir) {
+ // information about storage capacities
+ $storageInfo = \OC_Helper::getStorageInfo($dir);
+
$l = new \OC_L10N('files');
- $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir);
+ $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']);
$maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize);
$maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize;
- // information about storage capacities
- $storageInfo = \OC_Helper::getStorageInfo($dir);
-
return array('uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize,
'usedSpacePercent' => (int)$storageInfo['relative']);