From 16a413f03e5d20b1ff13bdc4e1fcb40a99c9a425 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 a584ddba4..45467716a 100644 --- a/lib/Controller/APIv2Controller.php +++ b/lib/Controller/APIv2Controller.php @@ -410,6 +410,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);