From 9f16d9b2fcf9b937d4fc46631f9bd3d813eb43f5 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Wed, 21 Nov 2018 22:02:51 +0100 Subject: [PATCH] Fixed: File names and release titles lacking a series title and starting with the Air date. fixes #2825 --- .../ParserTests/DailyEpisodeParserFixture.cs | 2 ++ src/NzbDrone.Core/Parser/Parser.cs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs index 0a915b0fd..f0b530261 100644 --- a/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/DailyEpisodeParserFixture.cs @@ -28,6 +28,8 @@ namespace NzbDrone.Core.Test.ParserTests //[TestCase("Corrie.07.01.15", "Corrie", 2015, 1, 7)] [TestCase("The Nightly Show with Larry Wilmore 2015 02 09 WEBRIP s01e13", "The Nightly Show with Larry Wilmore", 2015, 2, 9)] [TestCase("Jimmy_Fallon_2018_06_22_Seth_Meyers_720p_HEVC_x265-MeGusta", "Jimmy Fallon", 2018, 6, 22)] + [TestCase("20161024- Exotic Payback.21x41_720.mkv", "", 2016, 10, 24)] + [TestCase("2018-11-14.1080.all.mp4", "", 2018, 11, 14)] //[TestCase("", "", 0, 0, 0)] public void should_parse_daily_episode(string postTitle, string title, int year, int month, int day) { diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 41adfc35f..884d2bec2 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -22,6 +22,10 @@ namespace NzbDrone.Core.Parser // new Regex(@"^(?:(?\d{2,3})(?:_|-|\s|\.)+)+(?.+?)(?:\W|_)+(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2}(?!\d+)))+)", // RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Daily episodes without title (2018-10-12, 20181012) (Strict pattern to avoid false matches) + new Regex(@"^(?<airyear>19[6-9]\d|20\d\d)(?<sep>[-]?)(?<airmonth>0\d|1[0-2])\k<sep>(?<airday>[0-2]\d|3[01])(?!\d)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Multi-Part episodes without a title (S01E05.S01E06) new Regex(@"^(?:\W*S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,}", RegexOptions.IgnoreCase | RegexOptions.Compiled), @@ -173,7 +177,7 @@ namespace NzbDrone.Core.Parser // Anime - French titles with single episode numbers, with or without leading sub group ([RlsGroup] Title - Episode 1) new Regex(@"^(?:\[(?<subgroup>.+?)\][-_. ]?)?(?<title>.+?)[-_. ]+?(?:Episode[-_. ]+?)(?<absoluteepisode>\d{1}(?!\d+))", RegexOptions.IgnoreCase | RegexOptions.Compiled), - + //Season only releases new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))(\W+|_|$)(?<extras>EXTRAS|SUBPACK)?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), @@ -282,7 +286,7 @@ namespace NzbDrone.Core.Parser new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase), // 170424_26 - Started appearing August 2018 - new Regex(@"^\d{6}_\d{2}$"), + new Regex(@"^\d{6}_\d{2}$"), }; //Regex to detect whether the title was reversed.