diff options
author | Robin Appelman <robin@icewind.nl> | 2023-05-26 14:51:05 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-06-19 12:30:10 +0200 |
commit | 3fe52793552ef4ebf639d8c65a3313cc5c97501d (patch) | |
tree | 7fb0daaed2af8eb3abc584d2fc2dcd2c2ce34745 /lib | |
parent | db87b77926eabe7e44065f75506cdfecfb7cdbbc (diff) | |
download | nextcloud-server-3fe52793552ef4ebf639d8c65a3313cc5c97501d.tar.gz nextcloud-server-3fe52793552ef4ebf639d8c65a3313cc5c97501d.zip |
use source cache when listing folder during recursive copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 898f64d97c2..0ec1140cd24 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -35,6 +35,7 @@ use Icewind\Streams\IteratorDirectory; use OC\Files\Cache\Cache; use OC\Files\Cache\CacheEntry; use OC\Files\Storage\PolyFill\CopyDirectory; +use OCP\Files\Cache\ICache; use OCP\Files\Cache\ICacheEntry; use OCP\Files\FileInfo; use OCP\Files\NotFoundException; @@ -550,7 +551,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { if (is_array($sourceEntryData) && array_key_exists('scan_permissions', $sourceEntryData)) { $sourceEntry['permissions'] = $sourceEntryData['scan_permissions']; } - $this->copyInner($sourceEntry, $targetInternalPath); + $this->copyInner($sourceStorage->getCache(), $sourceEntry, $targetInternalPath); return true; } } @@ -568,12 +569,12 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { throw new NotFoundException('Source object not found'); } - $this->copyInner($sourceEntry, $path2); + $this->copyInner($cache, $sourceEntry, $path2); return true; } - private function copyInner(ICacheEntry $sourceEntry, string $to) { + private function copyInner(ICache $sourceCache, ICacheEntry $sourceEntry, string $to) { $cache = $this->getCache(); if ($sourceEntry->getMimeType() === FileInfo::MIMETYPE_FOLDER) { @@ -582,8 +583,8 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { } $this->mkdir($to); - foreach ($cache->getFolderContentsById($sourceEntry->getId()) as $child) { - $this->copyInner($child, $to . '/' . $child->getName()); + foreach ($sourceCache->getFolderContentsById($sourceEntry->getId()) as $child) { + $this->copyInner($sourceCache, $child, $to . '/' . $child->getName()); } } else { $this->copyFile($sourceEntry, $to); |