diff options
Diffstat (limited to 'lib/private/Preview/ProviderV2.php')
-rw-r--r-- | lib/private/Preview/ProviderV2.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Preview/ProviderV2.php b/lib/private/Preview/ProviderV2.php index e7cabd10337..1b5bee0e5cc 100644 --- a/lib/private/Preview/ProviderV2.php +++ b/lib/private/Preview/ProviderV2.php @@ -70,6 +70,10 @@ abstract class ProviderV2 implements IProviderV2 { */ abstract public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage; + protected function useTempFile(File $file) { + return $file->isEncrypted() || !$file->getStorage()->isLocal(); + } + /** * Get a path to either the local file or temporary file * @@ -78,8 +82,7 @@ abstract class ProviderV2 implements IProviderV2 { * @return string */ protected function getLocalFile(File $file, int $maxSize = null): string { - $useTempFile = $file->isEncrypted() || !$file->getStorage()->isLocal(); - if ($useTempFile) { + if ($this->useTempFile($file)) { $absPath = \OC::$server->getTempManager()->getTemporaryFile(); $content = $file->fopen('r'); |