diff --git a/Makefile b/Makefile index 8fd7fae..2106d00 100644 --- a/Makefile +++ b/Makefile @@ -10,13 +10,16 @@ lint: ## lint test: ## run tests @go test ./... -build: #vendor ## build +build: ## build $(GO_BUILD_ENV_VARS) \ go build \ -tags selinux \ $(GCFLAGS) \ -o bin/$(MODULE) ./ +container: clean build ## container + buildah bud -t rbtr/pachinko:latest . + clean: ## clean workspace @rm -rf ./bin ./$(MODULE) diff --git a/README.md b/README.md index a0938db..4f102a4 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ outputs: [] processors: {} ``` -the full, current list of options is available by running `./pachinko config` on the commandline. +the full, current list of options is available by running `./pachinko genconf` on the commandline. the core pachinko options are: | option | inputs | usage | diff --git a/internal/testing/testing.go b/internal/testing/testing.go index 6af28dc..1daf56c 100644 --- a/internal/testing/testing.go +++ b/internal/testing/testing.go @@ -46,7 +46,7 @@ var TV []*Test = []*Test{ }, }, { - "dir multimathc SSxEE", + "dir multimatch SSxEE", []string{ "/src/Broad City (2014) S01-03 Season 01-03 (1080p HEVC AAC 2.0)/Broad City 03x09 Getting There.mkv", }, @@ -84,6 +84,25 @@ var TV []*Test = []*Test{ }, }, }, + { + "special characters in title", + []string{ + "/src/Tom Clancy's Jack Ryan S01E01.mkv", + }, + types.Media{ + Category: types.Video, + Type: tv.TV, + TVMetadata: tv.Metadata{ + Name: "Tom Clancy's Jack Ryan", + Episode: tv.Episode{ + Number: 1, + Season: tv.Season{ + Number: 1, + }, + }, + }, + }, + }, } var Movies []*Test = []*Test{ diff --git a/plugin/processor/pre/tv.go b/plugin/processor/pre/tv.go index 3a12a76..7f4af39 100644 --- a/plugin/processor/pre/tv.go +++ b/plugin/processor/pre/tv.go @@ -20,12 +20,12 @@ import ( ) var defaultTVMatchers = []string{ - `(?i)\b([\s\w.-]*)[\s.\/-]+(?:\((\d+)\))?[\s.\/-]?(\d{1,3})[x-](\d{1,3})`, // matches 1x1 and 1/1 patterns - `(?i)\b([\s\w.-]*?)?(?:[\s\(.\/-](\d{4})[\s\).\/-])?[\s\w.-]?(?:s+(\d+))(?:\.|\s|-|_|x)*(?:e+(\d+))`, // matches S00E00 patterns - `(?i)\b([\s\w.-]*)[\s.\/-]+(?:\((\d+)\))?[\s.\/-]?(?:season|series).?(\d+).?(?:episode)?[^\d(]?(\d+)`, // matches Season 00 patterns + `(?i)\b([\s\w'.-]*)[\s.\/-]+(?:\((\d+)\))?[\s.\/-]?(\d{1,3})[x-](\d{1,3})`, // matches 1x1 and 1/1 patterns + `(?i)\b([\s\w'.-]*?)?(?:[\s\(.\/-](\d{4})[\s\).\/-])?[\s\w.-]?(?:s+(\d+))(?:\.|\s|-|_|x)*(?:e+(\d+))`, // matches S00E00 patterns + `(?i)\b([\s\w'.-]*)[\s.\/-]+(?:\((\d+)\))?[\s.\/-]?(?:season|series).?(\d+).?(?:episode)?[^\d(]?(\d+)`, // matches Season 00 patterns } -var sanitizer = regexp.MustCompile(`[^\w]`) +var sanitizer = regexp.MustCompile(`[^'\w]`) type TVPreProcessor struct { MatcherStrings []string `mapstructure:"matchers"`