From 3bd99a2b7b9702d6119f1e11649b1796062fa38b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 20 Oct 2011 14:30:45 -0700 Subject: [PATCH] Added Support for 1011 as a number convention. --- NzbDrone.Core.Test/ParserTest.cs | 1 + NzbDrone.Core/Parser.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index de6583347..19a062476 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -65,6 +65,7 @@ namespace NzbDrone.Core.Test [TestCase(@"D:\shares\TV Shows\Battlestar Galactica (2003)\Season 2\S02E21.avi", 2, 21)] [TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", 4, 5)] [TestCase(@"P:\TV Shows\House\Season 6\S06E13 - 5 to 9 - 720p BluRay.mkv", 6, 13)] + [TestCase(@"S:\TV Drop\House - 10x11 - Title [SDTV]\1011 - Title.avi", 10, 11)] public void PathParse_tests(string path, int season, int episode) { var result = Parser.ParsePath(path); diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index ab4e64ed4..a5e37785a 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -39,8 +39,12 @@ namespace NzbDrone.Core new Regex(@"^(?.*?)(?:\W?S?(?<season>\d{1,2}(?!\d+))(?:(?:\-|[ex]|\s)+(?<episode>\d+))+)+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports 1103/1113 naming + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{2})(?<episode>\d{2}))+\W?(?!\\)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports 103/113 naming - new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d+)(?<episode>\d{2}))+\W?(?!\\)", + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{1})(?<episode>\d{2}))+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports Season only releases