debug(author): Add debug logging to VIDEO_TS chapter extraction
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 <noreply@anthropic.com>
This commit is contained in:
parent
d240f1f773
commit
462dfb06c6
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user