diff --git a/internal/testing/testing.go b/internal/testing/testing.go index 5d5682b..83bd6ee 100644 --- a/internal/testing/testing.go +++ b/internal/testing/testing.go @@ -145,9 +145,10 @@ var TV []*Test = []*Test{ var Movies []*Test = []*Test{ { - "year as title", + "year in title", []string{ "/src/Blade Runner 2049 (2017)/Blade Runner 2049.mkv", + "/src/Blade Runner 2049 (2017).mkv", }, types.Item{ Category: types.Video, @@ -158,6 +159,20 @@ var Movies []*Test = []*Test{ }, }, }, + { + "year as title", + []string{ + "/movies/1917 (2020).mkv", + }, + types.Item{ + Category: types.Video, + MediaType: movie.Movie, + MovieMetadata: movie.Metadata{ + Title: "1917", + ReleaseYear: 2020, + }, + }, + }, { "typical", []string{ diff --git a/plugin/processor/pre/movie.go b/plugin/processor/pre/movie.go index c2a5fc8..5df7416 100644 --- a/plugin/processor/pre/movie.go +++ b/plugin/processor/pre/movie.go @@ -20,7 +20,7 @@ import ( ) var defaultMovieMatchers = []string{ - `(?i)\b([\s\w.-]*)[\s.\/-]+[\s.\/-]?(?:[\s\(.\/-]?(\d{4})[\s\).\/-]?)(?:\s*[\(\[].*[\)\]])?(?:\/|.[A-Za-z]{3})`, // matches "Name (YEAR)." + `(?i)\b([\s\w.-]*)[\s.-]?(?:[\s\(.-]?(\d{4})[\s\).-]?)(?:\s*[\(\[].*[\)\]])?(?:\/|.[A-Za-z]{3})`, // matches "Name (YEAR)." } type MoviePreProcessor struct {