Merge pull request #51561 from nextcloud/backport/50663/stable31

[stable31] enh: improve occ file:transfer-ownership logging
This commit is contained in:
Andy Scherzinger 2025-03-20 01:32:27 +01:00 committed by GitHub
commit 957ffda3cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,6 +141,8 @@ class OwnershipTransferService {
$sourcePath
);
$sourceSize = $view->getFileInfo($sourcePath)->getSize();
// transfer the files
$this->transferFiles(
$sourceUid,
@ -149,6 +151,7 @@ class OwnershipTransferService {
$view,
$output
);
$sizeDifference = $sourceSize - $view->getFileInfo($finalTarget)->getSize();
// transfer the incoming shares
if ($transferIncomingShares === true) {
@ -184,6 +187,9 @@ class OwnershipTransferService {
$shares,
$output
);
if ($sizeDifference !== 0) {
$output->writeln("Transferred folder have a size difference of: $sizeDifference Bytes which means the transfer may be incomplete. Please check the logs if there was any issue during the transfer operation.");
}
}
private function sanitizeFolderName(string $name): string {