From f4d180ee5c6be5b3d061a035299079fc675b945f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 17 Jul 2015 13:18:01 +0200 Subject: [PATCH] allow passing the fileinfo to the preview manager --- core/ajax/preview.php | 2 +- lib/private/preview.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/ajax/preview.php b/core/ajax/preview.php index c8bc05453e..b6362fb3a7 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -53,7 +53,7 @@ if (!$info instanceof OCP\Files\FileInfo || !$always && !\OC::$server->getPrevie \OC_Response::setStatus(404); } else { $preview = new \OC\Preview(\OC_User::getUser(), 'files'); - $preview->setFile($file); + $preview->setFile($file, $info); $preview->setMaxX($maxX); $preview->setMaxY($maxY); $preview->setScalingUp($scalingUp); diff --git a/lib/private/preview.php b/lib/private/preview.php index 1127048b7f..996bf81703 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -252,12 +252,13 @@ class Preview { * Sets the path of the file you want a preview of * * @param string $file + * @param \OCP\Files\FileInfo|null $info * * @return \OC\Preview */ - public function setFile($file) { + public function setFile($file, $info = null) { $this->file = $file; - $this->info = null; + $this->info = $info; if ($file !== '') { $this->getFileInfo();