diff --git a/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs index 2ac491e23..f573270c2 100644 --- a/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs @@ -167,6 +167,19 @@ public void should_parse_absolute_specials(string postTitle, string title, int a result.Special.Should().BeTrue(); } + [TestCase("[Underwater] Another OVA - The Other -Karma- (BD 1080p) [3A561D0E].mkv", "Another", 0)] + public void should_parse_absolute_specials_without_absolute_number(string postTitle, string title, int absoluteEpisodeNumber) + { + var result = Parser.Parser.ParseTitle(postTitle); + result.Should().NotBeNull(); + result.AbsoluteEpisodeNumbers.Should().BeEmpty(); + result.SeasonNumber.Should().Be(0); + result.EpisodeNumbers.Should().BeEmpty(); + result.SeriesTitle.Should().Be(title); + result.FullSeason.Should().BeFalse(); + result.Special.Should().BeTrue(); + } + [TestCase("[ANBU-AonE]_SeriesTitle_26-27_[F224EF26].avi", "SeriesTitle", 26, 27)] [TestCase("[Doutei] Some Good, Anime Show - 01-12 [BD][720p-AAC]", "Some Good, Anime Show", 1, 12)] [TestCase("Series Title (2010) - 01-02-03 - Episode Title (1) HDTV-720p", "Series Title (2010)", 1, 3)] diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index db3330946..1aaab6762 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -440,6 +440,10 @@ public static class Parser // Episodes without a title, Single episode numbers (S1E1, 1x1) new Regex(@"^(?:S?(?(?\d{1}(?!\d+))))", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + // Anime OVA special + new Regex(@"^\[(?.+?)\][-_. ]?(?.+?)(?:[-_. ]+(?<special>special|ova|ovd)).*?(?<hash>[(\[]\w{8}[)\]])?(?:$|\.mkv)", RegexOptions.IgnoreCase | RegexOptions.Compiled) }; @@ -614,6 +618,8 @@ public static ParsedEpisodeInfo ParsePath(string path) } } + // TODO: Skip for anime specials + if (result == null) { Logger.Debug("Attempting to parse episode info using combined directory and file names. {0}", fileInfo.Directory.Name); @@ -1015,6 +1021,10 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle result.SeasonPart = Convert.ToInt32(seasonPart); result.IsPartialSeason = true; } + else if (matchCollection[0].Groups["special"].Success) + { + result.Special = true; + } else { result.FullSeason = true;