diff --git a/src/server/file/index.ts b/src/server/file/index.ts index 22370ddd0..658117e3a 100644 --- a/src/server/file/index.ts +++ b/src/server/file/index.ts @@ -54,8 +54,14 @@ interface ISend { function thumbnail(data: stream.Readable, type: string, resize: number): ISend { const readable: stream.Readable = (() => { - // 動画か画像であれば - if (/^(?:video|image)\/.*$/.test(type) || type == 'application/xml') { + // 動画であれば + if (/^video\/.*$/.test(type)) { + // 実装は先延ばし + // 使わないことになったストリームはしっかり取り壊す + data.destroy(); + return fs.createReadStream(`${__dirname}/assets/thumbnail-not-available.png`); + // 画像であれば + } else if (/^image\/.*$/.test(type) || type == 'application/xml') { // 0フレーム目を送る try { return gm(data).selectFrame(0).stream();