From f09a7e05254583ccf5f941e15ee9080b52b5fdbe Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 2 May 2012 08:08:09 -0700 Subject: [PATCH] Fixed: Issue parsing certain multi-part episode names. --- NzbDrone.Core.Test/ParserTest.cs | 4 ++++ NzbDrone.Core/Parser.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 5dae0c382..dc798485c 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -166,6 +166,7 @@ namespace NzbDrone.Core.Test [TestCase("Pawn Stars S04E87 REPACK 720p HDTV x264 aAF", QualityTypes.HDTV, true)] [TestCase("The Real Housewives of Vancouver S01E04 DSR x264 2HD", QualityTypes.SDTV, false)] [TestCase("Vanguard S01E04 Mexicos Death Train DSR x264 MiNDTHEGAP", QualityTypes.SDTV, false)] + [TestCase("Vanguard S01E04 Mexicos Death Train 720 WEB DL", QualityTypes.WEBDL, false)] public void quality_parse(string postTitle, object quality, bool proper) { var result = Parser.ParseQuality(postTitle); @@ -201,6 +202,9 @@ namespace NzbDrone.Core.Test [TestCase("2x04x05.720p.BluRay-FUTV", "", 2, new[] { 4, 5 })] [TestCase("S02E04E05.720p.BluRay-FUTV", "", 2, new[] { 4, 5 })] [TestCase("S02E03-04-05.720p.BluRay-FUTV", "", 2, new[] { 3,4,5 })] + [TestCase("Breakout.Kings.S02E09-E10.HDTV.x264-ASAP", "Breakout Kings", 2, new[] { 9, 10 })] + [TestCase("Breakout Kings - 2x9-2x10 - Served Cold [SDTV] ", "Breakout Kings", 2, new[] { 9, 10 })] + [TestCase("Breakout Kings - 2x09-2x10 - Served Cold [SDTV] ", "Breakout Kings", 2, new[] { 9, 10 })] public void TitleParse_multi(string postTitle, string title, int season, int[] episodes) { var result = Parser.ParseTitle(postTitle); diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 5be664d8c..b5afc21a3 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Core RegexOptions.IgnoreCase | RegexOptions.Compiled), //Multi-episode Repeated (S01E05 - S01E06, 1x05 - 1x06, etc) - new Regex(@"^(?.+?)(?:\W+S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{2}(?!\d+)))+){2,}\W?(?!\\)", + new Regex(@"^(?<title>.+?)(?:\W+S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,2}(?!\d+)))+){2,}\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Episodes without a title, Single (S01E05, 1x05) AND Multi (S01E04E05, 1x04x05, etc)