From 1b4e504a57f025ba19588c4a5f47156b21c3e271 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 30 Dec 2025 16:52:40 -0500 Subject: [PATCH] Auto-create output directories for rip and author operations --- author_module.go | 8 ++++++++ rip_module.go | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/author_module.go b/author_module.go index 50c395f..436510f 100644 --- a/author_module.go +++ b/author_module.go @@ -1841,6 +1841,10 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg } if makeISO { + // Create output directory for ISO file if it doesn't exist + if err := os.MkdirAll(filepath.Dir(outputPath), 0755); err != nil { + return fmt.Errorf("failed to create ISO output directory: %w", err) + } tool, args, err := buildISOCommand(outputPath, discRoot, title) if err != nil { logFn(fmt.Sprintf("ERROR: ISO tool not found: %v", err)) @@ -1975,6 +1979,10 @@ func (s *appState) executeAuthorJob(ctx context.Context, job *queue.Job, progres } appendLog(fmt.Sprintf("Authoring ISO from VIDEO_TS: %s", videoTSPath)) + // Create output directory for ISO file if it doesn't exist + if err := os.MkdirAll(filepath.Dir(outputPath), 0755); err != nil { + return fmt.Errorf("failed to create ISO output directory: %w", err) + } tool, args, err := buildISOCommand(outputPath, videoTSPath, title) if err != nil { return err diff --git a/rip_module.go b/rip_module.go index aec352b..e78f700 100644 --- a/rip_module.go +++ b/rip_module.go @@ -357,6 +357,12 @@ func (s *appState) executeRipJob(ctx context.Context, job *queue.Job, progressCa } defer os.Remove(listFile) + // Create output directory if it doesn't exist + outputDir := filepath.Dir(outputPath) + if err := os.MkdirAll(outputDir, 0755); err != nil { + return fmt.Errorf("failed to create output directory: %w", err) + } + args := buildRipFFmpegArgs(listFile, outputPath, format) appendLog(fmt.Sprintf(">> ffmpeg %s", strings.Join(args, " "))) updateProgress(10)