perf(trashbin): avoid full rescan for uncached moves

Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
This commit is contained in:
Hoang Pham 2026-01-06 18:40:41 +07:00 committed by Robin Appelman
parent dc90d59e4f
commit e7641f7e06
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -350,7 +350,11 @@ class Trashbin implements IEventListener {
if ($inCache) {
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
} else {
$trashStorage->getUpdater()->update($trashInternalPath);
$sizeDifference = $sourceInfo->getSize();
if ($sizeDifference < 0) {
$sizeDifference = null;
}
$trashStorage->getUpdater()->update($trashInternalPath, null, $sizeDifference);
}
} catch (CopyRecursiveException $e) {
$moveSuccessful = false;