Indicate preview availability in recent file api responses

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
Richard Steinmetz 2020-12-10 15:32:33 +01:00
parent 27fdc6575d
commit f56eb82ddd
No known key found for this signature in database
GPG Key ID: 31BA3356F0FA2874
1 changed files with 1 additions and 0 deletions

View File

@ -179,6 +179,7 @@ class ApiController extends Controller {
/** @var \OC\Files\Node\Node $shareTypes */
$shareTypes = $this->getShareTypes($node);
$file = \OCA\Files\Helper::formatFileInfo($node->getFileInfo());
$file['hasPreview'] = $this->previewManager->isAvailable($node);
$parts = explode('/', dirname($node->getPath()), 4);
if (isset($parts[3])) {
$file['path'] = '/' . $parts[3];