Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/cache.php')
-rw-r--r--apps/files_sharing/lib/cache.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 0534d6dd89f..0b187a3c3ff 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -79,6 +79,8 @@ class Shared_Cache extends Cache {
$data['size'] = (int)$data['size'];
$data['mtime'] = (int)$data['mtime'];
$data['encrypted'] = (bool)$data['encrypted'];
+ $data['mimetype'] = $this->getMimetype($data['mimetype']);
+ $data['mimepart'] = $this->getMimetype($data['mimepart']);
return $data;
}
return false;
@@ -92,7 +94,12 @@ class Shared_Cache extends Cache {
*/
public function getFolderContents($folder) {
if ($folder == '') {
- return \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS);
+ $files = \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS);
+ foreach ($files as &$file) {
+ $file['mimetype'] = $this->getMimetype($file['mimetype']);
+ $file['mimepart'] = $this->getMimetype($file['mimepart']);
+ }
+ return $files;
} else {
if ($cache = $this->getSourceCache($folder)) {
return $cache->getFolderContents($this->files[$folder]);
@@ -130,6 +137,19 @@ class Shared_Cache extends Cache {
}
/**
+ * check if a file is available in the cache
+ *
+ * @param string $file
+ * @return bool
+ */
+ public function inCache($file) {
+ if ($file == '') {
+ return true;
+ }
+ return parent::inCache($file);
+ }
+
+ /**
* remove a file or folder from the cache
*
* @param string $file
@@ -176,7 +196,7 @@ class Shared_Cache extends Cache {
if ($cache = $this->getSourceCache($file)) {
return $cache->getStatus($this->files[$file]);
}
- return false;
+ return self::NOT_FOUND;
}
/**