Fix PDF thumbnail generation missing in backend, fix old CSS class override in ThumbnailImage
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m11s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m11s
This commit is contained in:
parent
3c3bf4dd8b
commit
093a6ac4ef
3 changed files with 4 additions and 4 deletions
|
|
@ -148,7 +148,7 @@ func (m *ThumbnailManager) worker(id int) {
|
||||||
err = generateVideoThumbnail(fullSourcePath, destPath)
|
err = generateVideoThumbnail(fullSourcePath, destPath)
|
||||||
} else if strings.HasPrefix(job.MimeType, "audio/") {
|
} else if strings.HasPrefix(job.MimeType, "audio/") {
|
||||||
err = generateAudioThumbnail(fullSourcePath, destPath)
|
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)
|
err = generateOfficeThumbnail(job.FilePath, destPath, m.Config)
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -1240,7 +1240,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
if (isMedia && file.checksum && viewMode === 'grid') {
|
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
|
// Use fallbackIcon for PDF too so it shows "PDF" text while loading
|
||||||
const currentFallback = ext === 'pdf' ? (
|
const currentFallback = ext === 'pdf' ? (
|
||||||
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-5 h-5 rounded text-[6px] flex-shrink-0 aspect-square'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-5 h-5 rounded text-[6px] flex-shrink-0 aspect-square'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@ export default function ThumbnailImage({ checksum, fallbackIcon, downloadToken,
|
||||||
key={key}
|
key={key}
|
||||||
src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''}
|
src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''}
|
||||||
alt=""
|
alt=""
|
||||||
className={`object-contain ${
|
className={`${
|
||||||
docType === 'pdf' ? 'w-full h-full object-cover object-top' :
|
docType === 'pdf' ? 'w-full h-full object-cover object-top' :
|
||||||
docType ? 'w-full h-full object-cover mix-blend-multiply' :
|
docType ? 'w-full h-full object-cover mix-blend-multiply' :
|
||||||
'w-full h-full'
|
'object-contain w-full h-full'
|
||||||
}`}
|
}`}
|
||||||
style={{ display: showFallback ? 'none' : 'block' }}
|
style={{ display: showFallback ? 'none' : 'block' }}
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
|
|
|
||||||
Reference in a new issue