Auto-create output directories for rip and author operations

This commit is contained in:
Stu Leak 2025-12-30 16:52:40 -05:00
parent 4a58a22b81
commit 1b4e504a57
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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)