diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 4437b5c8..5c109f8b 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -332,10 +332,13 @@ public class MediaDetection { // less reliable CWS deep matching matches.addAll(matchSeriesByName(folders, 2)); matches.addAll(matchSeriesByName(filenames, 2)); - } - // pass along only valid terms - names.addAll(stripBlacklistedTerms(matches)); + // pass along only valid terms + names.addAll(stripBlacklistedTerms(matches)); + } else { + // trust terms matched by 0-stance + names.addAll(matches); + } } catch (Exception e) { Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.WARNING, "Failed to match folder structure: " + e.getMessage(), e); } diff --git a/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java b/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java index a7ed4dec..04c68bca 100644 --- a/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java +++ b/source/net/sourceforge/filebot/similarity/SeasonEpisodeMatcher.java @@ -24,7 +24,7 @@ public class SeasonEpisodeMatcher { private Pattern seasonPattern; public SeasonEpisodeMatcher(SeasonEpisodeFilter sanity, boolean strict) { - patterns = new SeasonEpisodePattern[5]; + patterns = new SeasonEpisodePattern[6]; // match patterns like Season 01 Episode 02, ... patterns[0] = new SeasonEpisodePattern(null, "(? process(MatchResult match) { + List matches = new ArrayList(2); + Scanner epno = new Scanner(match.group(2)).useDelimiter("\\D+"); + while (epno.hasNext()) { + matches.add(new SxE(match.group(1), epno.next())); + } + return matches; + } + }; + + // match patterns 1.02, ..., 10.02, ... + patterns[3] = new SeasonEpisodePattern(sanity, "(? process(MatchResult match) { @@ -58,7 +72,7 @@ public class SeasonEpisodeMatcher { }; // match patterns like ep1, ep.1, ... - patterns[3] = new SeasonEpisodePattern(sanity, "(? process(MatchResult match) { @@ -68,7 +82,7 @@ public class SeasonEpisodeMatcher { }; // match patterns like 01, 102, 1003, 10102 (enclosed in separators) - patterns[4] = new SeasonEpisodePattern(sanity, "(? process(MatchResult match) { @@ -93,7 +107,7 @@ public class SeasonEpisodeMatcher { // only use S00E00 and SxE pattern in strict mode if (strict) { - patterns = new SeasonEpisodePattern[] { patterns[0], patterns[1], patterns[2] }; + patterns = new SeasonEpisodePattern[] { patterns[0], patterns[1], patterns[2], patterns[3] }; } // season folder pattern for complementing partial sxe info from filename