aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib
diff options
context:
space:
mode:
authorFelix Nieuwenhuizen <felix@tdlrali.com>2019-03-02 13:44:47 +0100
committerFelix Nieuwenhuizen <felix@tdlrali.com>2019-03-02 13:44:47 +0100
commit0f43d1dfaa2799f10c070a6d5f825fb3430bea4d (patch)
tree0a5a0840075c2d5876c9d38ba65938241e4b8ac2 /apps/files_versions/lib
parent1cfa870821c92bdd6854171c8c073ed16529b6df (diff)
downloadnextcloud-server-0f43d1dfaa2799f10c070a6d5f825fb3430bea4d.tar.gz
nextcloud-server-0f43d1dfaa2799f10c070a6d5f825fb3430bea4d.zip
use node API for free space calculation in versions app (same method as trashbin app)
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/Storage.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index e2e4888cbce..4ed3977435b 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -750,9 +750,11 @@ class Storage {
// subtract size of files and current versions size from quota
if ($quota >= 0) {
if ($softQuota) {
- $files_view = new View('/' . $uid . '/files');
- $rootInfo = $files_view->getFileInfo('/', false);
- $free = $quota - $rootInfo['size']; // remaining free space for user
+ $userFolder = \OC::$server->getUserFolder($uid);
+ if(is_null($userFolder)) {
+ return 0;
+ }
+ $free = $quota - $userFolder->getSize(false); // remaining free space for user
if ($free > 0) {
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions
} else {