From 390837ca060ed06f8845555cc101d67a5bdb2276 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 20 Feb 2025 09:17:15 +0000 Subject: [PATCH 1/3] if files-control quota wrapper is enable, exclude recovery --- patches/042-exclude-reovery-from-quota.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/042-exclude-reovery-from-quota.patch diff --git a/patches/042-exclude-reovery-from-quota.patch b/patches/042-exclude-reovery-from-quota.patch new file mode 100644 index 0000000..1e0033f --- /dev/null +++ b/patches/042-exclude-reovery-from-quota.patch @@ -0,0 +1,12 @@ +--- lib/private/legacy/OC_Helper.php 2025-02-20 10:12:51.017628329 +0100 ++++ lib/private/legacy/OC_Helper-new.php 2025-02-20 10:13:22.904956021 +0100 +@@ -540,6 +540,9 @@ + /** @var \OC\Files\Storage\Wrapper\Quota $storage */ + $quota = $sourceStorage->getQuota(); + } ++ if ($sourceStorage->instanceOfStorage('\OCA\FilesControls\Filesystem\QuotaWrapper')) { ++ $used = $sourceStorage->correctUsedStorage($used); ++ } + try { + $free = $sourceStorage->free_space($rootInfo->getInternalPath()); + if (is_bool($free)) { \ No newline at end of file -- GitLab From 400f8c94c693ac7262f957a21d749fb27969eb22 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Fri, 21 Feb 2025 14:52:17 +0000 Subject: [PATCH 2/3] removing call to quotawrapper --- patches/042-exclude-reovery-from-quota.patch | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/patches/042-exclude-reovery-from-quota.patch b/patches/042-exclude-reovery-from-quota.patch index 1e0033f..156274f 100644 --- a/patches/042-exclude-reovery-from-quota.patch +++ b/patches/042-exclude-reovery-from-quota.patch @@ -1,12 +1,16 @@ --- lib/private/legacy/OC_Helper.php 2025-02-20 10:12:51.017628329 +0100 -+++ lib/private/legacy/OC_Helper-new.php 2025-02-20 10:13:22.904956021 +0100 -@@ -540,6 +540,9 @@ ++++ lib/private/legacy/OC_Helper-new.php 2025-02-21 15:50:32.660042704 +0100 +@@ -539,6 +539,13 @@ + if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) { /** @var \OC\Files\Storage\Wrapper\Quota $storage */ $quota = $sourceStorage->getQuota(); ++ $recoveryFolder = \OC::$server->getConfig()->getSystemValue('murena_recovery', ''); ++ $rootFolder = \OC::$server->get(\OCP\Files\IRootFolder::class); ++ $userFolder = $rootFolder->getUserFolder($storage->getOwner($path)); ++ if(!empty($recoveryFolder) && $userFolder->nodeExists($recoveryFolder)){ ++ $recoverySize = $userFolder->get($recoveryFolder)->getSize(); ++ $used = max($used - $recoverySize, 0); ++ } } -+ if ($sourceStorage->instanceOfStorage('\OCA\FilesControls\Filesystem\QuotaWrapper')) { -+ $used = $sourceStorage->correctUsedStorage($used); -+ } try { - $free = $sourceStorage->free_space($rootInfo->getInternalPath()); - if (is_bool($free)) { \ No newline at end of file + $free = $sourceStorage->free_space($rootInfo->getInternalPath()); \ No newline at end of file -- GitLab From 057debfb476f76ab5c8a610dcaaf66891728e9ae Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 26 Feb 2025 21:42:44 +0000 Subject: [PATCH 3/3] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Akhil --- patches/042-exclude-reovery-from-quota.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/042-exclude-reovery-from-quota.patch b/patches/042-exclude-reovery-from-quota.patch index 156274f..d885227 100644 --- a/patches/042-exclude-reovery-from-quota.patch +++ b/patches/042-exclude-reovery-from-quota.patch @@ -4,7 +4,7 @@ if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) { /** @var \OC\Files\Storage\Wrapper\Quota $storage */ $quota = $sourceStorage->getQuota(); -+ $recoveryFolder = \OC::$server->getConfig()->getSystemValue('murena_recovery', ''); ++ $recoveryFolder = \OC::$server->getConfig()->getSystemValue('murena_recovery_folder_path', ''); + $rootFolder = \OC::$server->get(\OCP\Files\IRootFolder::class); + $userFolder = $rootFolder->getUserFolder($storage->getOwner($path)); + if(!empty($recoveryFolder) && $userFolder->nodeExists($recoveryFolder)){ -- GitLab