From 0a526951b68aedf6339307624e09e5b1b199d38f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 14 May 2012 16:21:31 -0700 Subject: [PATCH] Fixed: Daily episode parsing is less greedy. --- NzbDrone.Core.Test/ParserTest.cs | 3 +++ NzbDrone.Core/Parser.cs | 2 +- NzbDrone/NzbDrone.csproj | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 896635317..7112990b4 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -69,6 +69,7 @@ public class ParserTest : CoreTest [TestCase("Looney Tunes - S1936E18 - I Love to Singa", "Looney Tunes", 1936, 18)] [TestCase("American_Dad!_-_7x6_-_The_Scarlett_Getter_[SDTV]", "American Dad!", 7, 6)] [TestCase("Falling_Skies_-_1x1_-_Live_and_Learn_[HDTV]", "Falling Skies", 1, 1)] + [TestCase("Top Gear - 07x03 - 2005.11.70", "Top Gear", 7, 3)] public void ParseTitle_single(string postTitle, string title, int seasonNumber, int episodeNumber) { var result = Parser.ParseTitle(postTitle); @@ -169,6 +170,8 @@ public void unparsable_title_should_report_title() [TestCase("Vanguard S01E04 Mexicos Death Train 720 WEB DL", QualityTypes.WEBDL, false)] [TestCase("Hawaii Five 0 S02E21 720p WEB DL DD5 1 H 264", QualityTypes.WEBDL, false)] [TestCase("Castle S04E22 720p WEB DL DD5 1 H 264 NFHD", QualityTypes.WEBDL, false)] + [TestCase("Fringe S04E22 720p WEB-DL DD5.1 H264-EbP.mkv", QualityTypes.WEBDL, false)] + [TestCase("Fringe.S04E22.720p.WEB.DL.DD5.1.H264-EbP", QualityTypes.WEBDL, false)] public void quality_parse(string postTitle, object quality, bool proper) { var result = Parser.ParseQuality(postTitle); diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index b5afc21a3..0e33d0c6e 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -18,7 +18,7 @@ public static class Parser private static readonly Regex[] ReportTitleRegex = new[] { //Episodes with airdate - new Regex(@"^(?.+?)?\W*(?<airyear>\d{4})\W+(?<airmonth>\d{2})\W+(?<airday>\d{2})\W?(?!\\)", + new Regex(@"^(?<title>.+?)?\W*(?<airyear>\d{4})\W+(?<airmonth>[0-1][0-9])\W+(?<airday>[0-3][0-9])\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Multi-Part episodes without a title (S01E05.S01E06) diff --git a/NzbDrone/NzbDrone.csproj b/NzbDrone/NzbDrone.csproj index 4caa44f19..97e1d3b47 100644 --- a/NzbDrone/NzbDrone.csproj +++ b/NzbDrone/NzbDrone.csproj @@ -42,6 +42,7 @@ <WarningLevel>4</WarningLevel> <UseVSHostingProcess>true</UseVSHostingProcess> <CodeAnalysisRuleSet>BasicCorrectnessRules.ruleset</CodeAnalysisRuleSet> + <IntermediateOutputPath>C:\Users\MARK~1.MCD\AppData\Local\Temp\vs273.tmp\x86\Debug\</IntermediateOutputPath> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PlatformTarget>x86</PlatformTarget> @@ -51,6 +52,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <IntermediateOutputPath>C:\Users\MARK~1.MCD\AppData\Local\Temp\vs273.tmp\x86\Release\</IntermediateOutputPath> </PropertyGroup> <PropertyGroup> <ApplicationIcon>NzbDrone.ico</ApplicationIcon>