diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-04 11:10:54 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-04 11:16:23 +0200 |
commit | 5e8959a5b36f8ff150497d818ba09a8828ba5a7b (patch) | |
tree | b6448db70d5d2743fee01275a4269dc4305137c0 /apps/files_sharing/lib/api.php | |
parent | e4a3f8d3c44f3238071d03f793cd2c5395062b5e (diff) | |
download | nextcloud-server-5e8959a5b36f8ff150497d818ba09a8828ba5a7b.tar.gz nextcloud-server-5e8959a5b36f8ff150497d818ba09a8828ba5a7b.zip |
Return and use isPreviewAvailable for share previews
Since the mime type is known, now isPreviewAvailable is returned as well
and used by the JS side to properly render mime icon and previews.
Diffstat (limited to 'apps/files_sharing/lib/api.php')
-rw-r--r-- | apps/files_sharing/lib/api.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index 2e824a4a9df..50ba74f5beb 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -60,6 +60,9 @@ class Api { foreach ($shares as &$share) { if ($share['item_type'] === 'file' && isset($share['path'])) { $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['path']); + if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) { + $share['isPreviewAvailable'] = true; + } } $newShares[] = $share; } @@ -214,6 +217,9 @@ class Api { foreach ($shares as &$share) { if ($share['item_type'] === 'file') { $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']); + if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) { + $share['isPreviewAvailable'] = true; + } } } $result = new \OC_OCS_Result($shares); |