Pause the queue after the current clip for real, and carry global locks plus labeled permanence stills through generate and shot prompts.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -172,13 +172,15 @@ const props = defineProps<{
|
||||
folderId: string
|
||||
hideInputPreview?: boolean
|
||||
heading?: string
|
||||
stillOnly?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
updated: [payload: unknown]
|
||||
error: [message: string]
|
||||
select: [file: File, hidden: boolean]
|
||||
select: [file: File, hidden: boolean, stillId?: string]
|
||||
pick: [still: { id: string; filename: string; hideInput?: boolean }]
|
||||
}>()
|
||||
|
||||
const fileInput = ref<HTMLInputElement | null>(null)
|
||||
@@ -262,8 +264,10 @@ async function ingest(file: File) {
|
||||
body.append('folderId', current.value?.id || activeFolderId.value)
|
||||
body.append('hideInput', String(props.hideInputPreview === true))
|
||||
try {
|
||||
emit('updated', await $fetch('/api/library/stills', { method: 'POST', body }))
|
||||
emit('select', file, props.hideInputPreview === true)
|
||||
const result = await $fetch<{ still?: { id: string; filename: string; hideInput?: boolean } }>('/api/library/stills', { method: 'POST', body })
|
||||
emit('updated', result)
|
||||
if (result.still?.id) emit('pick', result.still)
|
||||
emit('select', file, props.hideInputPreview === true, result.still?.id)
|
||||
} catch (error: any) {
|
||||
emit('error', error?.data?.statusMessage || 'Could not save image')
|
||||
}
|
||||
@@ -283,10 +287,12 @@ function onDrop(event: DragEvent) {
|
||||
}
|
||||
|
||||
async function pickStill(still: PickerStill) {
|
||||
emit('pick', { id: still.id, filename: still.filename, hideInput: still.hideInput })
|
||||
if (props.stillOnly) return
|
||||
try {
|
||||
const blob = await $fetch<Blob>(`/api/library/stills/${still.id}`, { responseType: 'blob' })
|
||||
const file = new File([blob], still.filename, { type: blob.type || 'image/png' })
|
||||
emit('select', file, still.hideInput === true)
|
||||
emit('select', file, still.hideInput === true, still.id)
|
||||
} catch (error: any) {
|
||||
emit('error', error?.data?.statusMessage || 'Could not load that still')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user