From 1ce58c58afe4b6f539a6531707d4394d11ef2ed6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 24 Apr 2014 23:08:31 -0700 Subject: [PATCH] Fixed: Parsing daily episode formats that contain [] around the quality --- src/NzbDrone.Api/History/HistoryResource.cs | 2 +- src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Api/History/HistoryResource.cs b/src/NzbDrone.Api/History/HistoryResource.cs index e95330c52..2d9d0a07d 100644 --- a/src/NzbDrone.Api/History/HistoryResource.cs +++ b/src/NzbDrone.Api/History/HistoryResource.cs @@ -5,7 +5,7 @@ using NzbDrone.Api.REST; using NzbDrone.Api.Series; using NzbDrone.Core.History; using NzbDrone.Core.Qualities; -using NzbDrone.Core.Tv; + namespace NzbDrone.Api.History { diff --git a/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs index e889dc607..66b9b5733 100644 --- a/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs @@ -24,6 +24,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("2020.NZ.2012.16.02.PDTV.XviD-C4TV", "2020nz", 2012, 2, 16)] [TestCase("2020.NZ.2012.13.02.PDTV.XviD-C4TV", "2020nz", 2012, 2, 13)] [TestCase("2020.NZ.2011.12.02.PDTV.XviD-C4TV", "2020nz", 2011, 12, 2)] + [TestCase("Series Title - 2013-10-30 - Episode Title (1) [HDTV-720p]", "Series Title", 2013, 10, 30)] public void should_parse_daily_episode(string postTitle, string title, int year, int month, int day) { var result = Parser.Parser.ParseTitle(postTitle); diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index d75b1398d..5b4cf8d2d 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -59,7 +59,7 @@ namespace NzbDrone.Core.Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), //Anime - Title Absolute Episode Number [SubGroup] - new Regex(@"^(?.+?)(?:(?:_|-|\s|\.)+(?<absoluteepisode>\d{2,3}))+(?:.+?)\[(?<subgroup>.+?)\](?:\.|$)", + new Regex(@"^(?<title>.+?)(?:(?:_|-|\s|\.)+(?<absoluteepisode>\d{3}(?!\d+)))+(?:.+?)\[(?<subgroup>.+?)\](?:\.|$)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports 103/113 naming