From e085dde9585bef0b75d49b73d132d43ad27c47ef 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 7639a0a1c7..81e5a439c8 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -170,9 +170,11 @@ public function registerProvider() { return $container->query(OpenDocument::class); }); - $previewManager->registerProvider('/application\/pdf/', function () use ($container) { - return $container->query(Pdf::class); - }); + if (!$previewManager->isMimeSupported('application/pdf')) { + $previewManager->registerProvider('/application\/pdf/', function () use ($container) { + return $container->get(Pdf::class); + }); + } } public function checkAndEnableCODEServer() {