diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 34913a87d..034885c5c 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -281,6 +281,8 @@ namespace NzbDrone.Core.Test [TestCase("Chuck - 4x05 - Title", "Chuck")] [TestCase("Law & Order - 4x05 - Title", "laworder")] [TestCase("This Isn't a Valid Post", "")] + [TestCase("Mad Men - Season 1 [Bluray720p]", "madmen")] + [TestCase("Mad Men - Season 1 [Bluray1080p]", "madmen")] public void parse_series_name(string postTitle, string title) { var result = Parser.ParseSeriesName(postTitle); diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 3e230f5dd..a59e231fe 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -40,14 +40,14 @@ namespace NzbDrone.Core RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports 1103/1113 naming - new Regex(@"^(?.+?)?(?:\W?(?<season>\d{2})(?<episode>\d{2}))+\W?(?!\\)", + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{2})(?<episode>\d{2}(?!p|i)))+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports 103/113 naming - new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{1})(?<episode>\d{2}))+\W?(?!\\)", + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{1})(?<episode>\d{2}(?!p|i|\d+)))+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), - //Supports Season only releases + //Supports Season only releases new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W?(?<extras>EXTRAS|SUBPACK)?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) };