From 462dfb06c60cff2e73c3fa74a92a401c02cf9f2a Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Wed, 31 Dec 2025 08:44:03 -0500 Subject: [PATCH] debug(author): Add debug logging to VIDEO_TS chapter extraction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added comprehensive debug logging to extractChaptersFromVideoTS() function to diagnose chapter extraction issues: - Log VOB file search path - Log number of VOB files found and their paths - Log which VOB file is selected for chapter extraction - Log ffprobe errors if chapter extraction fails - Log number of chapters successfully extracted This will help debug why chapters aren't appearing when VIDEO_TS folders are dragged into the Author module. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- author_module.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/author_module.go b/author_module.go index fb99ec8..7888fca 100644 --- a/author_module.go +++ b/author_module.go @@ -1260,23 +1260,36 @@ func extractChaptersFromFile(path string) ([]authorChapter, error) { } func extractChaptersFromVideoTS(videoTSPath string) ([]authorChapter, error) { + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: searching for VOB files in: %s", videoTSPath) + // Try to find the main title VOB files // Usually VTS_01_1.VOB contains the main content vobFiles, err := filepath.Glob(filepath.Join(videoTSPath, "VTS_*_1.VOB")) - if err != nil || len(vobFiles) == 0 { + if err != nil { + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: glob error: %v", err) + return nil, fmt.Errorf("error searching for VOB files: %w", err) + } + if len(vobFiles) == 0 { + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: no VTS_*_1.VOB files found") return nil, fmt.Errorf("no VOB files found in VIDEO_TS") } + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: found %d VOB files: %v", len(vobFiles), vobFiles) + // Sort to get the first title set (usually the main feature) sort.Strings(vobFiles) mainVOB := vobFiles[0] + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: using main VOB: %s", mainVOB) + // Try to extract chapters from the main VOB using ffprobe chapters, err := extractChaptersFromFile(mainVOB) if err != nil { + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: ffprobe error: %v", err) return nil, err } + logging.Debug(logging.CatModule, "extractChaptersFromVideoTS: extracted %d chapters", len(chapters)) return chapters, nil }