From aa8125e7e4d4b58c180eef836426e47569cfd49d Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 25 Aug 2018 12:50:06 +0700 Subject: [PATCH] Improved support for rare SxE patterns (i.e. S1-01) --- source/net/filebot/similarity/SeasonEpisodeMatcher.java | 2 +- test/net/filebot/similarity/SeasonEpisodeMatcherTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/similarity/SeasonEpisodeMatcher.java b/source/net/filebot/similarity/SeasonEpisodeMatcher.java index 57b45a87..3d49a337 100644 --- a/source/net/filebot/similarity/SeasonEpisodeMatcher.java +++ b/source/net/filebot/similarity/SeasonEpisodeMatcher.java @@ -45,7 +45,7 @@ public class SeasonEpisodeMatcher { }); // match patterns like S01E01, s01e02, ... [s01]_[e02], s01.e02, s01e02a, s2010e01 ... s01e01-02-03-04, [s01]_[e01-02-03-04] ... - S00E00 = new SeasonEpisodePattern(null, "(? { + S00E00 = new SeasonEpisodePattern(null, "(? { return multi(m.group(1), m.group(2)); }); diff --git a/test/net/filebot/similarity/SeasonEpisodeMatcherTest.java b/test/net/filebot/similarity/SeasonEpisodeMatcherTest.java index b8d7be9d..6fe3bd30 100644 --- a/test/net/filebot/similarity/SeasonEpisodeMatcherTest.java +++ b/test/net/filebot/similarity/SeasonEpisodeMatcherTest.java @@ -66,6 +66,9 @@ public class SeasonEpisodeMatcherTest { // test high values assertEquals(new SxE(12, 345), matcher.match("Test - S12E345 - High Values").get(0)); + + // test odd patterns + assertEquals(new SxE(3, 4), matcher.match("S3-04").get(0)); } @Test