From a5cd1fc490b4b83f4f5fe463accb75af9585ae69 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 24 Mar 2011 08:27:41 -0700 Subject: [PATCH] Fixed REGEX for 103 (was looking for non-alphanumberic), still fails on 113 numbering, but will work for 103. --- NzbDrone.Core.Test/ParserTest.cs | 4 ++-- NzbDrone.Core/Parser.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 2252dc5c5..12b2ab5c3 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -14,8 +14,8 @@ namespace NzbDrone.Core.Test { [Test] [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", 3, 1)] - //[Row("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", 1, 3)] //This only worked because the 0 doesn't affect the results - //[Row("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", 1, 13)] //This failed because the 1 matters in this case + [Row("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", 1, 3)] //This only worked because the 0 doesn't affect the results + //[Row("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", 1, 13)] //This fails because the 1 matters in this case [Row("Chuck.4x05.HDTV.XviD-LOL", 4, 5)] [Row("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", 3, 6)] [Row("Degrassi.S10E27.WS.DSR.XviD-2HD", 10, 27)] diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index e6ee8fb90..a200f25d6 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core private static readonly Regex[] ReportTitleRegex = new[] { new Regex(@"(?.+?)?\W?(?<year>\d+?)?\WS?(?<season>\d+)(?:\-|\.|[a-z])(?<episode>\d+)\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), - new Regex(@"(?<title>.+?)?\W?(?<year>\d+?)?\WS?(?<season>\d+)\W(?<episode>\d+)\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) //Supports 103 naming + new Regex(@"(?<title>.+?)?\W?(?<year>\d+?)?\WS?(?<season>\d+)\w(?<episode>\d+)\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) //Supports 103 naming }; private static readonly Regex NormalizeRegex = new Regex(@"((\s|^)the(\s|$))|((\s|^)and(\s|$))|[^a-z]", RegexOptions.IgnoreCase | RegexOptions.Compiled);