Skip to content

Commit

Permalink
Use FileInfo's metadata for hidden prop
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Dec 19, 2023
1 parent bfee316 commit 6948c07
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 6948c07

Please sign in to comment.