Skip to content

Commit

Permalink
Merge pull request #42349 from nextcloud/artonge/perf/dav_hidden_prop
Browse files Browse the repository at this point in the history
Use FileInfo's metadata for hidden prop
  • Loading branch information
artonge authored Dec 19, 2023
2 parents fbcd5f4 + 6948c07 commit 2f647aa
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 2f647aa

Please sign in to comment.