aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-12-12 13:32:37 +0100
committerGitHub <noreply@github.com>2024-12-12 13:32:37 +0100
commit00d225aacbfa14faa6469f310aca88216b87199d (patch)
treea382301287b5f2eaf113780c8b96b3b7e6106684 /apps
parent4e92de20caa1cf5559809afa4bde5335d42f3029 (diff)
parentbe7b6a7b1b54e6ff967cf54dd305eeb15782490a (diff)
downloadnextcloud-server-00d225aacbfa14faa6469f310aca88216b87199d.tar.gz
nextcloud-server-00d225aacbfa14faa6469f310aca88216b87199d.zip
Merge pull request #49165 from nextcloud/backport/48563/stable30
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php3
-rw-r--r--apps/files/lib/Listener/SyncLivePhotosListener.php5
2 files changed, 8 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index fb8f6328683..2db23f390c8 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -8,6 +8,7 @@
namespace OCA\DAV\Connector\Sabre;
use OC\AppFramework\Http\Request;
+use OC\FilesMetadata\Model\FilesMetadata;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCP\Constants;
use OCP\Files\ForbiddenException;
@@ -581,7 +582,9 @@ class FilesPlugin extends ServerPlugin {
$propPatch->handle(
$mutation,
function (mixed $value) use ($accessRight, $knownMetadata, $node, $mutation, $filesMetadataManager): bool {
+ /** @var FilesMetadata $metadata */
$metadata = $filesMetadataManager->getMetadata((int)$node->getFileId(), true);
+ $metadata->setStorageId($node->getNode()->getStorage()->getCache()->getNumericStorageId());
$metadataKey = substr($mutation, strlen(self::FILE_METADATA_PREFIX));
// confirm metadata key is editable via PROPPATCH
diff --git a/apps/files/lib/Listener/SyncLivePhotosListener.php b/apps/files/lib/Listener/SyncLivePhotosListener.php
index c74a8370818..02cf85f9917 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);
}