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
|
||||
*/
|
||||
public function getQuotaInfo() {
|
||||
$rootInfo=\OC\Files\Filesystem::getFileInfo('');
|
||||
$storageInfo = OC_Helper::getStorageInfo($this->path);
|
||||
return array(
|
||||
$rootInfo['size'],
|
||||
\OC\Files\Filesystem::free_space()
|
||||
$storageInfo['used'],
|
||||
$storageInfo['total']
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -843,13 +843,13 @@ class OC_Helper {
|
|||
/**
|
||||
* Calculate the disc space
|
||||
*/
|
||||
public static function getStorageInfo() {
|
||||
$rootInfo = \OC\Files\Filesystem::getFileInfo('/');
|
||||
public static function getStorageInfo($path = '/') {
|
||||
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
|
||||
$used = $rootInfo['size'];
|
||||
if ($used < 0) {
|
||||
$used = 0;
|
||||
}
|
||||
$free = \OC\Files\Filesystem::free_space();
|
||||
$free = \OC\Files\Filesystem::free_space($path);
|
||||
if ($free >= 0) {
|
||||
$total = $free + $used;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue