Delete library stills from disk before the catalog write, and stop caching their media.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-10-25 17:55:30 -05:00
co-authored by Cursor
parent 545a3d749b
commit 20359bfbd4
26 changed files with 635 additions and 247 deletions
+4 -1
View File
@@ -1,8 +1,10 @@
import { existsSync } from 'node:fs'
import { sendPathWithRange } from '~/server/utils/httpRange'
import { setLibraryMediaHeaders } from '~/server/utils/library'
import { inlineFilename } from '~/shared/content-disposition.mjs'
export default defineEventHandler((event) => {
setLibraryMediaHeaders(event)
const { owner } = assertLibraryOwner(event)
const id = String(getRouterParam(event, 'id') || '')
const clip = getClip(owner, id)
@@ -13,6 +15,7 @@ export default defineEventHandler((event) => {
}
return sendPathWithRange(event, path, 'video/mp4', {
'Content-Disposition': inlineFilename(`${safeDownloadName(clipTitle(clip))}.mp4`),
'Cache-Control': 'private, max-age=0, must-revalidate'
'Cache-Control': 'no-store, no-cache, must-revalidate',
'Pragma': 'no-cache'
})
})