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:
@@ -1,6 +1,8 @@
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { setLibraryMediaHeaders } from '~/server/utils/library'
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
setLibraryMediaHeaders(event)
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
const id = String(getRouterParam(event, 'id') || '')
|
||||
const draft = getRetryDraft(owner, id)
|
||||
@@ -14,6 +16,5 @@ export default defineEventHandler((event) => {
|
||||
}
|
||||
const buf = readFileSync(path)
|
||||
setHeader(event, 'Content-Type', imageContentType(buf))
|
||||
setHeader(event, 'Cache-Control', 'private, max-age=3600')
|
||||
return buf
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user