Fixed: Parsing of some Anime releases with number at the end of the title

pull/5173/head
Mark McDowall 2 years ago
parent 381d642593
commit b3fc905481

@ -113,6 +113,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Anime Title S21 1000", "Anime Title S21", 1000, 0, 0)]
[TestCase("[HatSubs] Anime Title 1004 [E63F2984].mkv", "Anime Title", 1004, 0, 0)]
[TestCase("[GM-Team][][][Anime Title][Douro Mainland][2019][215][AVC][GB][1080P]", "Anime Title", 215, 0, 0)]
[TestCase("Mob Psycho 100 S3 - 01 (1080p) [5A493522]", "Mob Psycho 100 S3", 1, 0, 0)]
[TestCase("[SubsPlease] Mob Psycho 100 S3 - 01 (1080p) [5A493522]", "Mob Psycho 100 S3", 1, 0, 0)]
//[TestCase("", "", 0, 0, 0)]
public void should_parse_absolute_numbers(string postTitle, string title, int absoluteEpisodeNumber, int seasonNumber, int episodeNumber)

@ -146,6 +146,10 @@ namespace NzbDrone.Core.Parser
new Regex(@"^(?<title>.+?)[-_. ]+(?<absoluteepisode>(?<!\d+)\d{2}(?!\d+))[-_. ](\(\d{4}\))[-_. ]\[(?<subgroup>.+?)\]",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Anime - Title with trailing number, Absolute Episode Number and hash
new Regex(@"^(?<title>[^-]+?)(?:(?<![-_. ]|\b[0]\d+) - )(?:[-_. ]?(?<absoluteepisode>\d{2,3}(\.\d{1,2})?(?!\d+)))+(?:[-_. ]+(?<special>special|ova|ovd))?.*?(?<hash>\[\w{8}\])(?:$|\.mkv)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Anime - Title Absolute Episode Number [Hash]
new Regex(@"^(?<title>.+?)(?:(?:_|-|\s|\.)+(?<absoluteepisode>\d{2,3}(\.\d{1,2})?(?!\d+)))+(?:[-_. ]+(?<special>special|ova|ovd))?[-_. ]+.*?(?<hash>\[\w{8}\])(?:$|\.)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),

Loading…
Cancel
Save