allow passing the fileinfo to the preview manager
This commit is contained in:
parent
64994facce
commit
f4d180ee5c
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue