Fixed: Incorrectly Parsing [PublicHD] as Release Group

This commit is contained in:
bakerboy448 2021-08-01 15:30:33 -05:00 committed by GitHub
parent 155dbd4dd5
commit 3bbec2ff5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("SomeShow.S20E13.1080p.BluRay.DTS-MA.5.1.x264",null)] [TestCase("SomeShow.S20E13.1080p.BluRay.DTS-MA.5.1.x264",null)]
[TestCase("SomeShow.S20E13.1080p.BluRay.DTS-ES.5.1.x264",null)] [TestCase("SomeShow.S20E13.1080p.BluRay.DTS-ES.5.1.x264",null)]
[TestCase("SomeShow.S20E13.1080p.Blu-Ray.DTS-ES.5.1.x264",null)] [TestCase("SomeShow.S20E13.1080p.Blu-Ray.DTS-ES.5.1.x264",null)]
[TestCase("SomeShow.S20E13.1080p.Blu-Ray.DTS-ES.5.1.x264-ROUGH [PublicHD]", "ROUGH")]
//[TestCase("", "")] //[TestCase("", "")]
public void should_parse_release_group(string title, string expected) public void should_parse_release_group(string title, string expected)
{ {

View File

@ -416,7 +416,7 @@ namespace NzbDrone.Core.Parser
string.Empty, string.Empty,
RegexOptions.IgnoreCase | RegexOptions.Compiled); RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly RegexReplace CleanTorrentSuffixRegex = new RegexReplace(@"\[(?:ettv|rartv|rarbg|cttv)\]$", private static readonly RegexReplace CleanTorrentSuffixRegex = new RegexReplace(@"\[(?:ettv|rartv|rarbg|cttv|publichd)\]$",
string.Empty, string.Empty,
RegexOptions.IgnoreCase | RegexOptions.Compiled); RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -693,6 +693,7 @@ namespace NzbDrone.Core.Parser
break; break;
} }
title = WebsitePrefixRegex.Replace(title); title = WebsitePrefixRegex.Replace(title);
title = CleanTorrentSuffixRegex.Replace(title);
var animeMatch = AnimeReleaseGroupRegex.Match(title); var animeMatch = AnimeReleaseGroupRegex.Match(title);