diff --git a/file_properties.go b/file_properties.go deleted file mode 100644 index 5fcac23..0000000 --- a/file_properties.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -// type FileProperties struct { -// Filepath string -// Languages []string -// Subtitles []string -// Resolution model.Resolution -// } - -// var _ model.PropertyHolder = &FileProperties{} - -// // TODO cache -// func AnalyzeFile(path string) (*FileProperties, error) { -// props := &FileProperties{Filepath: path} - -// file, err := os.Open(path) -// if err != nil { -// return nil, err -// } -// defer file.Close() - -// data, err := ffprobe.ProbeReader(context.Background(), file) -// if err != nil { -// return nil, err -// } - -// defaultVideoLang := "" -// for _, s := range data.StreamType(ffprobe.StreamVideo) { -// if s.Disposition.Default > 0 { -// props.Resolution = model.Resolution(s.Height) -// defaultVideoLang = parsers.ParseLanguage(s.Tags.Language) -// break -// } -// } - -// for _, s := range data.StreamType(ffprobe.StreamAudio) { -// if s.Tags.Language != "" { -// props.Languages = append(props.Languages, parsers.ParseLanguage(s.Tags.Language)) -// } else if s.Disposition.Default > 0 { -// props.Languages = append(props.Languages, defaultVideoLang) -// } -// } - -// for _, s := range data.StreamType(ffprobe.StreamSubtitle) { -// if s.Tags.Language != "" { -// props.Subtitles = append(props.Subtitles, parsers.ParseLanguage(s.Tags.Language)) -// } else if s.Disposition.Default > 0 { -// props.Subtitles = append(props.Subtitles, defaultVideoLang) -// } -// } - -// return props, nil -// } - -// func (fp *FileProperties) GetLanguages() []string { -// return fp.Languages -// } - -// func (fp *FileProperties) GetSubtitles() []string { -// return fp.Subtitles -// } - -// func (fp *FileProperties) GetResolution() model.Resolution { -// return fp.Resolution -// }