Skip to content

Commit

Permalink
feat: improve occ file:transfer-ownership logging
Browse files Browse the repository at this point in the history
Signed-off-by: grnd-alt <[email protected]>
  • Loading branch information
grnd-alt committed Mar 6, 2025
1 parent 4c92c91 commit 3e1fd05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/files/lib/Service/OwnershipTransferService.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public function transfer(
$sourcePath
);

$sourceSize = $view->getFileInfo($sourcePath)->getSize();

// transfer the files
$this->transferFiles(
$sourceUid,
Expand All @@ -149,6 +151,7 @@ public function transfer(
$view,
$output
);
$sizeDifference = $sourceSize - $view->getFileInfo($finalTarget)->getSize();

// transfer the incoming shares
if ($transferIncomingShares === true) {
Expand Down Expand Up @@ -184,6 +187,9 @@ public function transfer(
$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 {
Expand Down

0 comments on commit 3e1fd05

Please sign in to comment.