use node API for free space calculation in versions app (same method as trashbin app)
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
This commit is contained in:
parent
1cfa870821
commit
0f43d1dfaa
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue