Merge pull request #24643 from nextcloud/fix/noid/recent-files-has-preview

Indicate preview availability in recent file api responses
This commit is contained in:
John Molakvoæ 2020-12-11 12:35:28 +01:00 committed by GitHub
commit 32f64b68e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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];