summaryrefslogtreecommitdiff
path: root/internal/video/story_run.go
blob: e3c1951b5c70734bd17e73ff026696a34a1696a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package video

import (
	"fmt"
	"os"
)

// RunStoryVideos runs the post-story gallery prompt and Veo generation when
// videoEnabled is true. When false, it returns immediately (e.g. --video=false).
//
// 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(videoEnabled bool, outputDir string, apiKey string) error {
	if !videoEnabled {
		return nil
	}

	selectedPaths, err := PromptForGalleryVideos(outputDir)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Warning: video prompt failed: %v\n", err)
		return nil
	}

	if err := GenerateSelectedVideos(apiKey, selectedPaths); err != nil {
		fmt.Fprintf(os.Stderr, "Warning: video generation failed: %v\n", err)
	}

	return nil
}