Skip to content

Commit

Permalink
update mov regex for year in title
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtr committed Apr 5, 2020
1 parent 11efbb4 commit 497bbd1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion internal/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion plugin/processor/pre/movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 497bbd1

Please sign in to comment.