From 13cd30b46c8341954648af21959594782c8b90bc Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Sun, 23 Jul 2017 14:06:28 -0700 Subject: [PATCH] expose the ParseFile function. --- arrange.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arrange.go b/arrange.go index 531dc5b..5a602b8 100644 --- a/arrange.go +++ b/arrange.go @@ -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()