aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Listener
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-10-03 17:35:56 +0200
committerRobin Appelman <robin@icewind.nl>2024-11-07 16:27:14 +0100
commit19ec79b3134bb2b78d900c05d62a913500eec282 (patch)
tree8078a1cf478479b0a66ea93fc334e7de9b2b655e /apps/files/lib/Listener
parent31f4f67c0c5ceace8f4c75daa29a0b51ddd3264a (diff)
downloadnextcloud-server-19ec79b3134bb2b78d900c05d62a913500eec282.tar.gz
nextcloud-server-19ec79b3134bb2b78d900c05d62a913500eec282.zip
fix: smuggle storage id to metadata insert queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files/lib/Listener')
-rw-r--r--apps/files/lib/Listener/SyncLivePhotosListener.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files/lib/Listener/SyncLivePhotosListener.php b/apps/files/lib/Listener/SyncLivePhotosListener.php
index 049d7319b64..34789187644 100644
--- a/apps/files/lib/Listener/SyncLivePhotosListener.php
+++ b/apps/files/lib/Listener/SyncLivePhotosListener.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
namespace OCA\Files\Listener;
+use OC\FilesMetadata\Model\FilesMetadata;
use OCA\Files\Service\LivePhotosService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
@@ -154,10 +155,14 @@ class SyncLivePhotosListener implements IEventListener {
* We have everything to update metadata and keep the link between the 2 copies.
*/
$newPeerFile = $peerFile->copy($targetParent->getPath() . '/' . $peerTargetName);
+ /** @var FilesMetadata $targetMetadata */
$targetMetadata = $this->filesMetadataManager->getMetadata($targetFile->getId(), true);
+ $targetMetadata->setStorageId($targetFile->getStorage()->getCache()->getNumericStorageId());
$targetMetadata->setString('files-live-photo', (string)$newPeerFile->getId());
$this->filesMetadataManager->saveMetadata($targetMetadata);
+ /** @var FilesMetadata $peerMetadata */
$peerMetadata = $this->filesMetadataManager->getMetadata($newPeerFile->getId(), true);
+ $peerMetadata->setStorageId($newPeerFile->getStorage()->getCache()->getNumericStorageId());
$peerMetadata->setString('files-live-photo', (string)$targetFile->getId());
$this->filesMetadataManager->saveMetadata($peerMetadata);
}