diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2025-05-20 14:25:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-20 14:25:08 +0200 |
commit | 00a940bd744eac36dc23776bc8eade25aafcd547 (patch) | |
tree | 47a1102cee8fd5d037bb3074c33d970cbbb3b7af /lib/private | |
parent | 21fa1c3bb39aa007081aa75621c5e450d7bb4b2e (diff) | |
parent | bdc3521619535c0a908f7d06a3297c004cbdb8bc (diff) | |
download | nextcloud-server-stable30.tar.gz nextcloud-server-stable30.zip |
Merge pull request #52983 from nextcloud/backport/52859/stable30stable30
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/PreviewManager.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 568fe8d1a4c..caf68b178e3 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -151,7 +151,7 @@ class PreviewManager implements IPreview { $mimeType = null, bool $cacheResult = true, ): ISimpleFile { - $this->throwIfPreviewsDisabled(); + $this->throwIfPreviewsDisabled($file); $previewConcurrency = $this->getGenerator()->getNumConcurrentPreviews('preview_concurrency_all'); $sem = Generator::guardWithSemaphore(Generator::SEMAPHORE_ID_ALL, $previewConcurrency); try { @@ -175,7 +175,7 @@ class PreviewManager implements IPreview { * @since 19.0.0 */ public function generatePreviews(File $file, array $specifications, $mimeType = null) { - $this->throwIfPreviewsDisabled(); + $this->throwIfPreviewsDisabled($file); return $this->getGenerator()->generatePreviews($file, $specifications, $mimeType); } @@ -452,8 +452,8 @@ class PreviewManager implements IPreview { /** * @throws NotFoundException if preview generation is disabled */ - private function throwIfPreviewsDisabled(): void { - if (!$this->enablePreviews) { + private function throwIfPreviewsDisabled(File $file): void { + if (!$this->isAvailable($file)) { throw new NotFoundException('Previews disabled'); } } |