diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-06 11:25:37 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-06 11:25:37 +0300 |
| commit | ef1f3d03ac3f117fecd999fc4fa96f557bfa8fe4 (patch) | |
| tree | f1d3507db5699d86045090e64db99781611c99b7 /cmd | |
| parent | 8f906ac9efc703db4f15c39115394ca8cf01c119 (diff) | |
feat: add --video CLI flag to control Veo video prompt after story generation
Add VideoEnabled bool (default true) to Flags, register --video bool flag in
command.go, export PromptForGalleryVideos/GenerateSelectedVideos, and wire them
into main.go via runStoryVideos — skipped when --video=false. Also update
findGalleryPages to walk subdirectories recursively so gallery PNGs inside
comics/<slug>/ are discovered from the CWD search root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/totalrecall/main.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index 9e64897..2c08497 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -117,7 +117,10 @@ func runCommand(cmd *cobra.Command, args []string, flags *cli.Flags) error { NarratorVoice: flags.NarratorVoice, Slug: flags.StorySlug, }) - return runner.Run(flags.StoryFile) + if err := runner.Run(flags.StoryFile); err != nil { + return err + } + return runStoryVideos(flags) } // Auto-adjust image size for DALL-E 3 @@ -187,6 +190,25 @@ func runGUIMode(proc *processor.Processor, flags *cli.Flags) error { return nil } +// runStoryVideos is called after the story runner completes. When the +// --video flag is true (default), it prompts the user to select gallery pages +// for Veo video generation and then generates the selected videos. +// Passing --video=false skips the prompt entirely. +func runStoryVideos(flags *cli.Flags) error { + if !flags.VideoEnabled { + return nil + } + + // The story runner writes gallery PNGs into ./comics/<slug>/, so we search + // from "." recursively to find them regardless of the exact slug. + selected, err := cli.PromptForGalleryVideos(".") + if err != nil { + return fmt.Errorf("video prompt: %w", err) + } + + return cli.GenerateSelectedVideos(cli.GetGoogleAPIKey(), selected, ".") +} + // storyUltraRealistic converts the --no-ultra-realistic bool flag into a *bool // for RunnerConfig. When noUltraRealistic is true, returns a pointer to false // (forcing standard comic style). When false (flag not set), returns nil so |
