From 4771b1c1b23b11b4a82e7133f8be983f14265faa Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 30 Jan 2016 11:16:59 -0800 Subject: [PATCH] New: Parsing of XofY mini series format Closes #1091 --- .../ParserTests/SingleEpisodeParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index 88af00d5d..037dae126 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -117,6 +117,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("grp-zoos01e11-1080p", "grp-zoo", 1, 11)] [TestCase("grp-zoo-s01e11-1080p", "grp-zoo", 1, 11)] [TestCase("Jeopardy!.S2016E14.2016-01-20.avi", "Jeopardy!", 2016, 14)] + [TestCase("Ken.Burns.The.Civil.War.5of9.The.Universe.Of.Battle.1990.DVDRip.x264-HANDJOB", "Ken Burns The Civil War", 1, 5)] //[TestCase("", "", 0, 0)] public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) { diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 10fc663ff..725a381fa 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -78,6 +78,10 @@ namespace NzbDrone.Core.Parser new Regex(@"^(?.+?)(?:\W+(?:(?:Part\W?|(?<!\d+\W+)e)(?<episode>\d{1,2}(?!\d+)))+)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Mini-Series, treated as season 1, episodes are labelled as XofY + new Regex(@"^(?<title>.+?)(?:\W+(?:(?<episode>(?<!\d+)\d{1,2}(?!\d+))of\d+)+)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports Season 01 Episode 03 new Regex(@"(?:.*(?:\""|^))(?<title>.*?)(?:[-_\W](?<![()\[]))+(?:\W?Season\W?)(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:\W|_)+(?:Episode\W)(?:[-_. ]?(?<episode>(?<!\d+)\d{1,2}(?!\d+)))+", RegexOptions.IgnoreCase | RegexOptions.Compiled),