aboutsummaryrefslogtreecommitdiffstats
path: root/parser/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'parser/parser.go')
-rw-r--r--parser/parser.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/parser/parser.go b/parser/parser.go
index 621992d..3378154 100644
--- a/parser/parser.go
+++ b/parser/parser.go
@@ -60,6 +60,18 @@ func (m *Media) PathIn(dir *template.Template) (string, error) {
return path, nil
}
+func Guess(s string) (Media, string, error) {
+ show, err := Show(s)
+ if err != nil {
+ movie, err := Movie(s)
+ if err != nil {
+ return Media{}, "", fmt.Errorf("could not guess media: %q", s)
+ }
+ return movie, "movie", err
+ }
+ return show, "show", nil
+}
+
func Default(s string) (Media, error) {
return Media{Release: s}, nil
}