]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix mimetypes in shared cache
authorMichael Gapczynski <mtgap@owncloud.com>
Mon, 7 Jan 2013 20:27:22 +0000 (15:27 -0500)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 7 Jan 2013 20:27:22 +0000 (15:27 -0500)
apps/files_sharing/lib/cache.php

index 0534d6dd89fc4ad871b7fe830c9bc9299fcc0500..8b989db3b079e38267f7f1927ace71270fc8487a 100644 (file)
@@ -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]);