From 939af551dcf4bdbecc8af10c24e1caeda86771f1 Mon Sep 17 00:00:00 2001 From: Elijah Kuntz Date: Thu, 11 Jun 2026 11:44:27 -0700 Subject: [PATCH] Fix thumbnail aspect ratios and missing thumbnails in All tab --- backend/handlers/onlyoffice.go | 2 +- frontend/src/components/ThumbnailImage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/handlers/onlyoffice.go b/backend/handlers/onlyoffice.go index 87357e5..67a2fad 100644 --- a/backend/handlers/onlyoffice.go +++ b/backend/handlers/onlyoffice.go @@ -335,7 +335,7 @@ func (h *OnlyOfficeHandler) ListOfficeFiles(c *fiber.Ctx) error { var results []OfficeFile checksums := make(map[string]string) - rows, err := h.DB.Query("SELECT path, checksum FROM files WHERE checksum != '' AND is_trashed = 0") + rows, err := h.DB.Query("SELECT path, checksum FROM files WHERE checksum IS NOT NULL AND checksum != '' AND IFNULL(is_trashed, 0) = 0") if err == nil { defer rows.Close() for rows.Next() { diff --git a/frontend/src/components/ThumbnailImage.tsx b/frontend/src/components/ThumbnailImage.tsx index f25b15b..cede2e1 100644 --- a/frontend/src/components/ThumbnailImage.tsx +++ b/frontend/src/components/ThumbnailImage.tsx @@ -32,7 +32,7 @@ export default function ThumbnailImage({ checksum, fallbackIcon, downloadToken, key={key} src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''} alt="" - className={`object-contain ${docType ? 'w-full h-full object-cover mix-blend-multiply' : 'w-full h-full'}`} + className={`object-contain ${docType ? 'w-full h-full mix-blend-multiply' : 'w-full h-full'}`} style={{ display: showFallback ? 'none' : 'block' }} onError={(e) => { if (errorCount < 20) {