webdav quota now displays the same values as the web interface does
This commit is contained in:
parent
7d141656ee
commit
1e4ebf47e2
|
@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQuotaInfo() {
|
public function getQuotaInfo() {
|
||||||
$rootInfo=\OC\Files\Filesystem::getFileInfo('');
|
$storageInfo = OC_Helper::getStorageInfo($this->path);
|
||||||
return array(
|
return array(
|
||||||
$rootInfo['size'],
|
$storageInfo['used'],
|
||||||
\OC\Files\Filesystem::free_space()
|
$storageInfo['total']
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -843,13 +843,13 @@ class OC_Helper {
|
||||||
/**
|
/**
|
||||||
* Calculate the disc space
|
* Calculate the disc space
|
||||||
*/
|
*/
|
||||||
public static function getStorageInfo() {
|
public static function getStorageInfo($path = '/') {
|
||||||
$rootInfo = \OC\Files\Filesystem::getFileInfo('/');
|
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
|
||||||
$used = $rootInfo['size'];
|
$used = $rootInfo['size'];
|
||||||
if ($used < 0) {
|
if ($used < 0) {
|
||||||
$used = 0;
|
$used = 0;
|
||||||
}
|
}
|
||||||
$free = \OC\Files\Filesystem::free_space();
|
$free = \OC\Files\Filesystem::free_space($path);
|
||||||
if ($free >= 0) {
|
if ($free >= 0) {
|
||||||
$total = $free + $used;
|
$total = $free + $used;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue