summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-13 17:27:27 +0200
committerGitHub <noreply@github.com>2020-10-13 17:27:27 +0200
commit7525fb3408de8d8f0098fa8fd1ce2bba373347cd (patch)
tree861066f914add2018b869aec800de9ffdcb05e2f /apps/files_sharing/lib
parente1a0b3f98fb28ec3d193f32a85dd77795baf88f7 (diff)
parent89f7e2ab6409ef034ab6d4ce73f45517ae4f5d3f (diff)
downloadnextcloud-server-7525fb3408de8d8f0098fa8fd1ce2bba373347cd.tar.gz
nextcloud-server-7525fb3408de8d8f0098fa8fd1ce2bba373347cd.zip
Merge pull request #23350 from st3iny/fix/14849/share-api-preview-availability
Inidicate preview availability in share api responses
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 3abe4f6dbe9..2c2ec393d3f 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -62,6 +62,7 @@ use OCP\Files\NotFoundException;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N;
+use OCP\IPreview;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IURLGenerator;
@@ -106,6 +107,8 @@ class ShareAPIController extends OCSController {
private $serverContainer;
/** @var IUserStatusManager */
private $userStatusManager;
+ /** @var IPreview */
+ private $previewManager;
/**
* Share20OCS constructor.
@@ -137,7 +140,8 @@ class ShareAPIController extends OCSController {
IConfig $config,
IAppManager $appManager,
IServerContainer $serverContainer,
- IUserStatusManager $userStatusManager
+ IUserStatusManager $userStatusManager,
+ IPreview $previewManager
) {
parent::__construct($appName, $request);
@@ -153,6 +157,7 @@ class ShareAPIController extends OCSController {
$this->appManager = $appManager;
$this->serverContainer = $serverContainer;
$this->userStatusManager = $userStatusManager;
+ $this->previewManager = $previewManager;
}
/**
@@ -213,6 +218,7 @@ class ShareAPIController extends OCSController {
}
$result['mimetype'] = $node->getMimetype();
+ $result['has_preview'] = $this->previewManager->isAvailable($node);
$result['storage_id'] = $node->getStorage()->getId();
$result['storage'] = $node->getStorage()->getCache()->getNumericStorageId();
$result['item_source'] = $node->getId();