diff --git a/backend/workers/thumbnails.go b/backend/workers/thumbnails.go index d26ca4b..9cee374 100644 --- a/backend/workers/thumbnails.go +++ b/backend/workers/thumbnails.go @@ -148,7 +148,7 @@ func (m *ThumbnailManager) worker(id int) { err = generateVideoThumbnail(fullSourcePath, destPath) } else if strings.HasPrefix(job.MimeType, "audio/") { err = generateAudioThumbnail(fullSourcePath, destPath) - } else if strings.HasSuffix(job.FilePath, ".docx") || strings.HasSuffix(job.FilePath, ".pptx") || strings.HasSuffix(job.FilePath, ".xlsx") { + } else if strings.HasSuffix(strings.ToLower(job.FilePath), ".pdf") || strings.HasSuffix(strings.ToLower(job.FilePath), ".docx") || strings.HasSuffix(strings.ToLower(job.FilePath), ".pptx") || strings.HasSuffix(strings.ToLower(job.FilePath), ".xlsx") { err = generateOfficeThumbnail(job.FilePath, destPath, m.Config) } else { continue diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index 40dde0c..3dc1678 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -1240,7 +1240,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { })(); if (isMedia && file.checksum && viewMode === 'grid') { - const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : file.name.endsWith('.pdf') ? 'pdf' : null; + const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : ext === 'pdf' ? 'pdf' : null; // Use fallbackIcon for PDF too so it shows "PDF" text while loading const currentFallback = ext === 'pdf' ? (