diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-06 11:28:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-06 11:28:48 +0300 |
| commit | cd45f841932052435a28f669405b23f313d9cf62 (patch) | |
| tree | 81a01f7d28176da3de847243ec3c78087301fea3 /cmd | |
| parent | ef1f3d03ac3f117fecd999fc4fa96f557bfa8fe4 (diff) | |
fix: correct video integration after comic generation
PromptForGalleryVideos now returns []string paths (from recursive walk)
instead of []int page numbers, so GenerateSelectedVideos always has the
exact path to each gallery PNG regardless of which comics/<slug>/
subdirectory it lives in.
Previously, GenerateSelectedVideos passed "." as galleryPath and called
loadGalleryImage with a non-recursive filepath.Glob that could not find
PNGs in subdirectories, causing video generation to always fail with
"no gallery image found".
Additional changes:
- Add VeoGenerator.GenerateVideoFromPath that accepts a full image path
and writes the MP4 next to the source PNG
- Make runStoryVideos non-fatal: video errors print a warning and return
nil so comic/PDF/narration outputs are never invalidated by Veo errors
- Add filterPathsByPages helper and tests for the new behaviour
- Add TestFindGalleryPages_Recursive to cover the comics/<slug>/ layout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/totalrecall/main.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index 2c08497..13fa1bd 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -194,6 +194,10 @@ func runGUIMode(proc *processor.Processor, flags *cli.Flags) error { // --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. +// +// Video generation failures are intentionally non-fatal: the comic, PDF, and +// narration are already on disk, so a Veo API error should not invalidate +// those outputs. Errors are printed as warnings and the function returns nil. func runStoryVideos(flags *cli.Flags) error { if !flags.VideoEnabled { return nil @@ -201,12 +205,19 @@ func runStoryVideos(flags *cli.Flags) error { // 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(".") + // PromptForGalleryVideos returns the actual file paths (not just page numbers) + // so GenerateSelectedVideos can locate them without a second directory search. + selectedPaths, err := cli.PromptForGalleryVideos(".") if err != nil { - return fmt.Errorf("video prompt: %w", err) + fmt.Fprintf(os.Stderr, "Warning: video prompt failed: %v\n", err) + return nil + } + + if err := cli.GenerateSelectedVideos(cli.GetGoogleAPIKey(), selectedPaths); err != nil { + fmt.Fprintf(os.Stderr, "Warning: video generation failed: %v\n", err) } - return cli.GenerateSelectedVideos(cli.GetGoogleAPIKey(), selected, ".") + return nil } // storyUltraRealistic converts the --no-ultra-realistic bool flag into a *bool |
