From 43fa8a1f660be62dd881de40e58282d26ead17ab Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 19 Sep 2011 21:29:04 -0700 Subject: [PATCH] Fixed broken Season parsing REGEX, added test to verify issue without parsing XML. --- NzbDrone.Core.Test/ParserTest.cs | 1 + NzbDrone.Core/Parser.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 20d599a8d..5445e5394 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -331,6 +331,7 @@ namespace NzbDrone.Core.Test [TestCase("Eureka Season 1 720p WEB DL DD 5 1 h264 TjHD", "Eureka", 1)] [TestCase("The Office Season4 WS PDTV XviD FUtV", "The Office", 4)] [TestCase("Eureka S 01 720p WEB DL DD 5 1 h264 TjHD", "Eureka", 1)] + [TestCase("Doctor Who Confidential Season 3", "Doctor Who Confidential", 3)] public void parse_season_info(string postTitle, string seriesName, int seasonNumber) { var result = Parser.ParseTitle(postTitle); diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 25279b3f5..4711e41c5 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports Season only releases - new Regex(@"^(?.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W(?<extras>EXTRAS)?(?!\\)", + new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W?(?<extras>EXTRAS)?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) };