expose the ParseFile function.

This commit is contained in:
Stephen McQuay 2017-07-23 14:06:28 -07:00
parent b4ee62151d
commit 13cd30b46c
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D

View File

@ -92,7 +92,7 @@ func Parse(in <-chan string) <-chan Media {
out := make(chan Media)
go func() {
for path := range in {
f, err := _parse(path)
f, err := ParseFile(path)
if err != nil {
switch err.(type) {
case NotMedia:
@ -149,7 +149,8 @@ func Move(in <-chan Media, root string) <-chan error {
return out
}
func _parse(path string) (Media, error) {
// ParseFile extracts metadata from single file.
func ParseFile(path string) (Media, error) {
ext := strings.ToLower(filepath.Ext(path))
var r Media
hash := md5.New()