From cdf01f04194a9de30e4247338a5b2675cb1c3ece Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Thu, 3 Sep 2015 19:48:42 +0100 Subject: Split mimetype handling to new class --- apps/files_sharing/lib/cache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index c25dc92409f..377c9f02253 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -47,6 +47,7 @@ class Shared_Cache extends Cache { * @param \OC\Files\Storage\Shared $storage */ public function __construct($storage) { + parent::__construct($storage); $this->storage = $storage; } @@ -94,6 +95,7 @@ class Shared_Cache extends Cache { * @return array|false */ public function get($file) { + $mimetypeLoader = \OC::$server->getMimeTypeLoader(); if (is_string($file)) { $cache = $this->getSourceCache($file); if ($cache) { @@ -130,8 +132,8 @@ class Shared_Cache extends Cache { $data['mtime'] = (int)$data['mtime']; $data['storage_mtime'] = (int)$data['storage_mtime']; $data['encrypted'] = (bool)$data['encrypted']; - $data['mimetype'] = $this->getMimetype($data['mimetype']); - $data['mimepart'] = $this->getMimetype($data['mimepart']); + $data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']); + $data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']); if ($data['storage_mtime'] === 0) { $data['storage_mtime'] = $data['mtime']; } -- cgit v1.2.3