Generate video thumbnails (#4084)

* Generate video thumbnails

* import order
This commit is contained in:
MeiMei 2019-02-02 13:22:09 +09:00 committed by syuilo
parent 170b1bb4cc
commit 3040700005
7 changed files with 51 additions and 4 deletions

View file

@ -64,7 +64,12 @@ export default async function(ctx: Koa.BaseContext) {
const bucket = await getDriveFileThumbnailBucket();
ctx.body = bucket.openDownloadStream(thumb._id);
} else {
await sendRaw();
if (file.contentType.startsWith('image/')) {
await sendRaw();
} else {
ctx.status = 404;
await send(ctx as any, '/dummy.png', { root: assets });
}
}
} else if ('web' in ctx.query) {
const web = await DriveFileWebpublic.findOne({