diff --git a/src/servers/api/file-browser/thumbnails.ts b/src/servers/api/file-browser/thumbnails.ts index 5e1596f8..82de48be 100644 --- a/src/servers/api/file-browser/thumbnails.ts +++ b/src/servers/api/file-browser/thumbnails.ts @@ -44,7 +44,33 @@ import sharp from 'sharp'; * file icons was the most visible gap this had. */ const IMAGE_EXT = new Set(['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'avif', 'tif', 'tiff', 'svg', 'heic', 'heif']); -const VIDEO_EXT = new Set(['mp4', 'mov', 'm4v', 'webm', 'mkv', 'avi', 'wmv', 'flv', 'mpg', 'mpeg', 'ts', '3gp']); +/* + `ts` is NOT here, and that is the one entry worth explaining. + + It is a real video extension — MPEG transport stream — and it was in this list until a deploy to fofos + reported `test-setup.ts` as a video. On any machine Officer runs on, `.ts` is TypeScript approximately + always, so including it meant every source file in every repository drew a play badge and spawned an + ffmpeg that could only fail. + + The two ways of being wrong are not the same size. Excluded, a genuine transport stream shows a file + icon; included, browsing a source tree runs a decoder per file. Nobody stores broadcast captures in a + folder they browse from here. +*/ +const VIDEO_EXT = new Set([ + 'mp4', + 'mov', + 'm4v', + 'webm', + 'mkv', + 'avi', + 'wmv', + 'flv', + 'mpg', + 'mpeg', + '3gp', + 'm2ts', + 'mts', +]); export const thumbnailKind = (name: string): 'image' | 'video' | null => { const ext = extname(name).slice(1).toLowerCase();