1
0
mirror of https://github.com/Sonarr/Sonarr synced 2025-10-05 23:52:45 +02:00

New: Don't reparse OVA with folder name

Closes #8083
This commit is contained in:
Mark McDowall
2025-09-27 21:45:29 -07:00
parent a4a18d6121
commit 994faa60c6
2 changed files with 23 additions and 0 deletions

View File

@@ -167,6 +167,19 @@ namespace NzbDrone.Core.Test.ParserTests
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)]

View File

@@ -440,6 +440,10 @@ namespace NzbDrone.Core.Parser
// Episodes without a title, Single episode numbers (S1E1, 1x1)
new Regex(@"^(?:S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[-_ ]?[ex])(?<episode>\d{1}(?!\d+))))",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
// Anime OVA special
new Regex(@"^\[(?<subgroup>.+?)\][-_. ]?(?<title>.+?)(?:[-_. ]+(?<special>special|ova|ovd)).*?(?<hash>[(\[]\w{8}[)\]])?(?:$|\.mkv)",
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
@@ -614,6 +618,8 @@ namespace NzbDrone.Core.Parser
}
}
// 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 @@ namespace NzbDrone.Core.Parser
result.SeasonPart = Convert.ToInt32(seasonPart);
result.IsPartialSeason = true;
}
else if (matchCollection[0].Groups["special"].Success)
{
result.Special = true;
}
else
{
result.FullSeason = true;