1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-11 11:55:03 -05:00

Improved support for rare SxE patterns (i.e. S1-01)

This commit is contained in:
Reinhard Pointner 2018-08-25 12:50:06 +07:00
parent 3f06296fa7
commit aa8125e7e4
2 changed files with 4 additions and 1 deletions

View File

@ -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, "(?<!\\p{Digit})[Ss](\\d{1,2}|\\d{4})[^\\p{Alnum}]{0,3}(?i:ep|e|p)(((?<=[^._ ])[Ee]?[Pp]?\\d{1,3}(\\D|$))+)", m -> {
S00E00 = new SeasonEpisodePattern(null, "(?<!\\p{Digit})[Ss](\\d{1,2}|\\d{4})[^\\p{Alnum}]{0,3}(?i:ep|e|p|-)(((?<=[^._ ])[Ee]?[Pp]?\\d{1,3}(\\D|$))+)", m -> {
return multi(m.group(1), m.group(2));
});

View File

@ -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