Merge pull request #14454 from nextcloud/feature/noid/use-node-api-for-trashbin
Use node API for trash bin with special flag for getSize()
This commit is contained in:
commit
d0d1c85def
|
@ -680,10 +680,11 @@ class Trashbin {
|
||||||
// calculate available space for trash bin
|
// calculate available space for trash bin
|
||||||
// subtract size of files and current trash bin size from quota
|
// subtract size of files and current trash bin size from quota
|
||||||
if ($softQuota) {
|
if ($softQuota) {
|
||||||
$files_view = new View('/' . $user . '/files');
|
$userFolder = \OC::$server->getUserFolder($user);
|
||||||
$rootInfo = $files_view->getFileInfo('/', false);
|
if(is_null($userFolder)) {
|
||||||
$free = $quota - $rootInfo['size']; // remaining free space for user
|
return 0;
|
||||||
|
}
|
||||||
|
$free = $quota - $userFolder->getSize(false); // remaining free space for user
|
||||||
if ($free > 0) {
|
if ($free > 0) {
|
||||||
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
|
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue