mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 12:00:39 -05:00
fix(TransferOwnershipService): Remove groupfolders size
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
153eaca548
commit
eef7f81421
2 changed files with 24 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ use OC\User\NoUserException;
|
|||
use OCA\Encryption\Util;
|
||||
use OCA\Files\Exception\TransferOwnershipException;
|
||||
use OCA\Files_External\Config\ConfigAdapter;
|
||||
use OCA\GroupFolders\Mount\GroupMountPoint;
|
||||
use OCP\Encryption\IManager as IEncryptionManager;
|
||||
use OCP\Files\Config\IHomeMountProvider;
|
||||
use OCP\Files\Config\IUserMountCache;
|
||||
|
|
@ -157,6 +158,28 @@ class OwnershipTransferService {
|
|||
);
|
||||
$sizeDifference = $sourceSize - $view->getFileInfo($finalTarget)->getSize();
|
||||
|
||||
// Files in Team folders are not transferred, so their size needs to be subtracted to avoid warnings about size differences
|
||||
$mounts = Server::get(IMountManager::class)->getAll();
|
||||
foreach ($mounts as $mount) {
|
||||
if (!$mount instanceof GroupMountPoint || !str_starts_with($mount->getMountPoint(), '/' . $sourcePath . '/')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$storage = $mount->getStorage();
|
||||
if ($storage === null) {
|
||||
$output->writeln('Failed to get storage for mount: ' . $mount->getMountPoint());
|
||||
continue;
|
||||
}
|
||||
|
||||
$rootCacheEntry = $storage->getCache()->get('');
|
||||
if ($rootCacheEntry === false) {
|
||||
$output->writeln('Failed to get root cache entry for storage: ' . $mount->getMountPoint());
|
||||
continue;
|
||||
}
|
||||
|
||||
$sizeDifference -= $rootCacheEntry->getSize();
|
||||
}
|
||||
|
||||
// transfer the incoming shares
|
||||
$sourceShares = $this->collectIncomingShares(
|
||||
$sourceUid,
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@
|
|||
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
|
||||
<referencedClass name="OCA\GlobalSiteSelector\Service\SlaveService"/>
|
||||
<referencedClass name="OCA\Guests\UserBackend"/>
|
||||
<referencedClass name="OCA\GroupFolders\Mount\GroupMountPoint"/>
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
<UndefinedFunction>
|
||||
|
|
|
|||
Loading…
Reference in a new issue