Keep pause across Coolify restarts, apply the chosen still from the image picker, and remux clips with Range/faststart so finished video can be scrubbed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-28 08:15:52 -05:00
co-authored by Cursor
parent 870150f052
commit 7d783bd97e
12 changed files with 338 additions and 49 deletions
+6 -5
View File
@@ -1,4 +1,5 @@
import { existsSync, readFileSync } from 'node:fs'
import { existsSync } from 'node:fs'
import { sendPathWithRange } from '~/server/utils/httpRange'
export default defineEventHandler((event) => {
const { owner } = assertLibraryOwner(event)
@@ -9,8 +10,8 @@ export default defineEventHandler((event) => {
if (!existsSync(path)) {
throw createError({ statusCode: 404, statusMessage: 'Video file is missing' })
}
setHeader(event, 'Content-Type', 'video/mp4')
setHeader(event, 'Content-Disposition', `inline; filename="${safeDownloadName(clipTitle(clip))}.mp4"`)
setHeader(event, 'Cache-Control', 'private, no-store')
return readFileSync(path)
return sendPathWithRange(event, path, 'video/mp4', {
'Content-Disposition': `inline; filename="${safeDownloadName(clipTitle(clip))}.mp4"`,
'Cache-Control': 'private, max-age=0, must-revalidate'
})
})