From 365c43f635b69c2fe6d97bd71ec136a267c860fb Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 5 Mar 2012 00:49:11 +0000 Subject: [PATCH] * SxE detection for "Season N Episode N" pattern --- .../similarity/SeasonEpisodeMatcher.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java b/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java index ef7352d2..084504b2 100644 --- a/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java +++ b/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java @@ -16,22 +16,25 @@ import java.util.regex.Pattern; public class SeasonEpisodeMatcher { - public static final SeasonEpisodeFilter DEFAULT_SANITY = new SeasonEpisodeFilter(50, 50, -1); + public static final SeasonEpisodeFilter DEFAULT_SANITY = new SeasonEpisodeFilter(50, 50, 1000); private SeasonEpisodePattern[] patterns; public SeasonEpisodeMatcher(SeasonEpisodeFilter sanity, boolean strict) { - patterns = new SeasonEpisodePattern[4]; + patterns = new SeasonEpisodePattern[5]; + + // match patterns like Season 01 Episode 02, ... + patterns[0] = new SeasonEpisodePattern(null, "(? process(MatchResult match) { @@ -41,7 +44,7 @@ public class SeasonEpisodeMatcher { }; // match patterns like 01, 102, 1003 (enclosed in separators) - patterns[3] = new SeasonEpisodePattern(sanity, "(? process(MatchResult match) { @@ -58,7 +61,7 @@ public class SeasonEpisodeMatcher { // only use S00E00 and SxE pattern in strict mode if (strict) { - patterns = new SeasonEpisodePattern[] { patterns[0], patterns[1] }; + patterns = new SeasonEpisodePattern[] { patterns[0], patterns[1], patterns[2] }; } }