Fixed: Don't use extended episode number as release group

This commit is contained in:
Mark McDowall 2019-01-30 18:31:01 -08:00
parent 47db1db861
commit 561fdef815
2 changed files with 10 additions and 0 deletions

View File

@ -30,6 +30,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Ghosted.S01E08.Haunted.Hayride.720p.AMZN.WEBRip.DDP5.1.x264-NTb-postbot", "NTb")]
[TestCase("Ghosted.S01E08.Haunted.Hayride.720p.AMZN.WEBRip.DDP5.1.x264-NTb-xpost", "NTb")]
[TestCase("Series Title - S01E01 - Episode Title [RlsGroup]", "RlsGroup")]
[TestCase("Black Monday S01 E01-E02 1080p AMZN WEBRip DDP5.1 x264 monkee", null)]
//[TestCase("", "")]
public void should_parse_release_group(string title, string expected)
{

View File

@ -328,6 +328,10 @@ namespace NzbDrone.Core.Parser
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+)(?<!WEB-DL|480p|720p|1080p|2160p)(?:\b|[-._ ])|[-._ ]\[(?<releasegroup>[a-z0-9]+)\]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex InvalidReleaseGroupRegex = new Regex(@"^[se]\d+$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex AnimeReleaseGroupRegex = new Regex(@"^(?:\[(?<subgroup>(?!\s).+?(?<!\s))\](?:_|-|\s|\.)?)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -571,6 +575,11 @@ namespace NzbDrone.Core.Parser
return null;
}
if (InvalidReleaseGroupRegex.IsMatch(group))
{
return null;
}
return group;
}