From d2374f7555b2a0d0d1da45c71f04f495c5f05b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 16 Aug 2023 10:22:26 +0200 Subject: [PATCH] fix: Disable pdf preview gnerator through Collabora if server already has support for it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/AppInfo/Application.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index dd0544dc6b..17ab2c9948 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -172,9 +172,11 @@ public function registerProvider() { return $container->get(OpenDocument::class); }); - $previewManager->registerProvider('/application\/pdf/', function () use ($container) { - return $container->get(Pdf::class); - }); + if (!$previewManager->isMimeSupported('application/pdf')) { + $previewManager->registerProvider('/application\/pdf/', function () use ($container) { + return $container->get(Pdf::class); + }); + } } public function checkAndEnableCODEServer() {