Add a Director section to save and reload multi-shot video scripts.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { listDirectorScripts, saveDirectorScript } from '~/server/utils/directorScripts'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
const body = await readBody<{
|
||||
name?: string
|
||||
text?: string
|
||||
overwrite?: boolean
|
||||
}>(event).catch(() => ({}))
|
||||
const script = await saveDirectorScript(owner, {
|
||||
name: body?.name || '',
|
||||
text: body?.text || '',
|
||||
overwrite: body?.overwrite === true
|
||||
})
|
||||
return {
|
||||
script,
|
||||
scripts: listDirectorScripts(owner)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user