Add an image batch-script popup that splits a pasted shot list onto the start still.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+9
-2
@@ -4,9 +4,8 @@ export interface ParsedShot {
|
||||
role: 'initial' | 'extension'
|
||||
}
|
||||
|
||||
export function parseShotScript(text: string): ParsedShot[] {
|
||||
function parseMarkedBlocks(text: string, marker: RegExp): ParsedShot[] {
|
||||
const src = String(text || '').replace(/\r\n/g, '\n')
|
||||
const marker = /^[ \t]*shot\s+(\d+)\b/gim
|
||||
const markers: { n: number; start: number; end: number }[] = []
|
||||
for (const match of src.matchAll(marker)) {
|
||||
markers.push({
|
||||
@@ -41,3 +40,11 @@ export function parseShotScript(text: string): ParsedShot[] {
|
||||
role: index === 0 ? 'initial' : 'extension'
|
||||
}))
|
||||
}
|
||||
|
||||
export function parseShotScript(text: string): ParsedShot[] {
|
||||
return parseMarkedBlocks(text, /^[ \t]*shot\s+(\d+)\b/gim)
|
||||
}
|
||||
|
||||
export function parseImageBatchScript(text: string): ParsedShot[] {
|
||||
return parseMarkedBlocks(text, /^[ \t]*(?:shot|image|prompt)\s+(\d+)\b/gim)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user