Merge pull request #19436 from nextcloud/bugfix/noid/dav-quota-calculation
Do not include mountpoints when calculating quota usage on WebDAV
This commit is contained in:
commit
b8b53a2d9a
|
@ -326,7 +326,8 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol
|
|||
return $this->quotaInfo;
|
||||
}
|
||||
try {
|
||||
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $this->info);
|
||||
$info = $this->fileView->getFileInfo($this->path, false);
|
||||
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $info);
|
||||
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
|
||||
$free = \OCP\Files\FileInfo::SPACE_UNLIMITED;
|
||||
} else {
|
||||
|
|
|
@ -295,6 +295,10 @@ class DirectoryTest extends \Test\TestCase {
|
|||
->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$this->view->expects($this->once())
|
||||
->method('getFileInfo')
|
||||
->willReturn($this->info);
|
||||
|
||||
$dir = new Directory($this->view, $this->info);
|
||||
$this->assertEquals([200, -3], $dir->getQuotaInfo()); //200 used, unlimited
|
||||
}
|
||||
|
@ -327,6 +331,10 @@ class DirectoryTest extends \Test\TestCase {
|
|||
->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$this->view->expects($this->once())
|
||||
->method('getFileInfo')
|
||||
->willReturn($this->info);
|
||||
|
||||
$dir = new Directory($this->view, $this->info);
|
||||
$this->assertEquals([200, 800], $dir->getQuotaInfo()); //200 used, 800 free
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue