From 6948c074e98b96b7a7b62ca8be3fc9b62f914c37 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 18 Dec 2023 11:44:44 +0100 Subject: [PATCH] Use FileInfo's metadata for hidden prop Signed-off-by: Louis Chemineau --- apps/dav/lib/Connector/Sabre/FilesPlugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 81cdfa464b59c..f7904e8788331 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -388,9 +388,9 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) } $propFind->handle(self::HIDDEN_PROPERTYNAME, function () use ($node) { - $filesMetadataManager = \OCP\Server::get(IFilesMetadataManager::class); - $metadata = $filesMetadataManager->getMetadata((int)$node->getFileId(), true); - return $metadata->hasKey('files-live-photo') && $node->getFileInfo()->getMimetype() === 'video/quicktime' ? 'true' : 'false'; + $isLivePhoto = isset($node->getFileInfo()->getMetadata()['files-live-photo']); + $isMovFile = $node->getFileInfo()->getMimetype() === 'video/quicktime'; + return ($isLivePhoto && $isMovFile) ? 'true' : 'false'; }); /**