From 23b76f4c326fb47500070e0f38f01c097faeef3c Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 20 Oct 2026 10:40:28 -0400 Subject: [PATCH] fix(api): fall back to MIME icon when preview generation fails Request MIME icon fallback for activity preview URLs. If a preview provider is available but cannot generate a thumbnail for a file, the preview endpoint can redirect to the file's MIME-type icon instead of returning a broken image. Fixes #760 Signed-off-by: Josh --- lib/Controller/APIv2Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Controller/APIv2Controller.php b/lib/Controller/APIv2Controller.php index dd2dbad5a..dbb9101b7 100644 --- a/lib/Controller/APIv2Controller.php +++ b/lib/Controller/APIv2Controller.php @@ -413,6 +413,7 @@ protected function getPreview(string $owner, int $fileId, string $filePath): arr 'y' => 250, 'fileId' => $fileId, 'c' => $fileInfo->getEtag(), + 'mimeFallback' => 1, ]; $preview['source'] = $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', $params);