Make title from file metadata optional

This commit is contained in:
WithoutPants
2019-10-12 19:20:27 +11:00
parent d8b566250e
commit afcadd941b
12 changed files with 105 additions and 24 deletions

View File

@@ -89,7 +89,7 @@ func parse(filePath string, probeJSON *FFProbeJSON) (*VideoFile, error) {
if result.Title == "" {
// default title to filename
result.Title = filepath.Base(result.Path)
result.SetTitleFromPath()
}
result.Comment = probeJSON.Format.Tags.Comment
@@ -161,3 +161,7 @@ func (v *VideoFile) getStreamIndex(fileType string, probeJSON FFProbeJSON) int {
return -1
}
func (v *VideoFile) SetTitleFromPath() {
v.Title = filepath.Base(v.Path)
}