mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-16 06:57:36 -07:00
Fix non media thumbnails (#4380)
This commit is contained in:
parent
8aa6b24638
commit
f3321c3d9e
3 changed files with 5 additions and 2 deletions
BIN
src/client/assets/thumbnail-not-available.png
(Stored with Git LFS)
Normal file
BIN
src/client/assets/thumbnail-not-available.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -8,7 +8,7 @@ export default function(file: IDriveFile, thumbnail = false): string {
|
|||
|
||||
if (file.metadata.withoutChunks) {
|
||||
if (thumbnail) {
|
||||
return file.metadata.thumbnailUrl || file.metadata.webpublicUrl || (isImage ? file.metadata.url : null);
|
||||
return file.metadata.thumbnailUrl || file.metadata.webpublicUrl || (isImage ? file.metadata.url : '/assets/thumbnail-not-available.png');
|
||||
} else {
|
||||
return file.metadata.webpublicUrl || file.metadata.url;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ export default async function(ctx: Koa.BaseContext) {
|
|||
await sendRaw();
|
||||
} else {
|
||||
ctx.status = 404;
|
||||
await send(ctx as any, '/dummy.png', { root: assets });
|
||||
await send(ctx as any, '/thumbnail-not-available.png', { root: assets });
|
||||
}
|
||||
}
|
||||
} else if ('web' in ctx.query) {
|
||||
|
|
Loading…
Reference in a new issue