diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-08 19:51:15 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-09-08 19:51:15 +0200 |
commit | 1b708e26efbcb4052becad3d7b6618064c2605a6 (patch) | |
tree | 3ce46be9556190cfe32ad304a7a35c200b583acd /lib/private/preview.php | |
parent | f3e6e0121d8a86cf7a5782a2cc06295da221c56c (diff) | |
download | nextcloud-server-1b708e26efbcb4052becad3d7b6618064c2605a6.tar.gz nextcloud-server-1b708e26efbcb4052becad3d7b6618064c2605a6.zip |
Show cached previews directly
Diffstat (limited to 'lib/private/preview.php')
-rw-r--r-- | lib/private/preview.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php index 978da1161c2..db2a56f9fa5 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -772,6 +772,12 @@ class Preview { throw new NotFoundException('File not found.'); } + if ($cachedPath = $this->isCached($this->info->getId())) { + header('Content-Type: ' . $this->info->getMimetype()); + $this->userView->readfile($cachedPath); + return; + } + if (is_null($this->preview)) { $this->getPreview(); } |