Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use FileInfo's metadata for hidden prop
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Dec 19, 2023
commit 6948c074e98b96b7a7b62ca8be3fc9b62f914c37
6 changes: 3 additions & 3 deletions apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
});

/**
Expand Down