From a1a0a653e60df48b3c97194b3a31b6e231268034 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 30 Dec 2025 20:37:24 -0500 Subject: [PATCH] Use meaningful chapter names from metadata or filenames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When authoring DVDs from multiple videos, chapters now display: - Video metadata title if available - Filename without extension as fallback - Instead of generic "Chapter 1", "Chapter 2", etc. This provides better navigation experience in DVD players. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- author_module.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/author_module.go b/author_module.go index 21449c2..e2a7c4b 100644 --- a/author_module.go +++ b/author_module.go @@ -1757,19 +1757,26 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg // Generate clips from paths if clips is empty (fallback for when job didn't save clips) if len(clips) == 0 && len(paths) > 1 { - for i, path := range paths { + for _, path := range paths { src, err := probeVideo(path) duration := 0.0 displayName := filepath.Base(path) + chapterTitle := strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)) if err == nil { duration = src.Duration displayName = src.DisplayName + // Use metadata title if available, otherwise use filename + if src.Metadata != nil { + if title, ok := src.Metadata["title"]; ok && strings.TrimSpace(title) != "" { + chapterTitle = title + } + } } clips = append(clips, authorClip{ Path: path, DisplayName: displayName, Duration: duration, - ChapterTitle: fmt.Sprintf("Chapter %d", i+1), + ChapterTitle: chapterTitle, }) } if logFn != nil {