fix: fix parsing release hash values that contained 8b or 10b

pull/6573/head
Alanoll 3 months ago
parent 28bde8cef3
commit 9c4f2dd167

@ -22,6 +22,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series Title - 031 - The Resolution to Kill [Lunar].avi", "Lunar", "")]
[TestCase("[ACX]Series Title 01 Episode Name [Kosaka] [9C57891E].mkv", "ACX", "9C57891E")]
[TestCase("[S-T-D] Series Title! - 06 (1280x720 10bit AAC) [59B3F2EA].mkv", "S-T-D", "59B3F2EA")]
[TestCase("[DHD] Series Title! - 08 (1280x720 10bit AAC) [8B8BF2EA].mkv", "DHD", "8B8BF2EA")]
[TestCase("[DHD] Series Title! - 10 (1280x720 10bit AAC) [10BBF2EA].mkv", "DHD", "10BBF2EA")]
public void should_parse_absolute_numbers(string postTitle, string subGroup, string hash)
{
var result = Parser.Parser.ParseTitle(postTitle);
@ -45,6 +47,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series Title - 031 - The Resolution to Kill [Lunar].avi", "Lunar", "")]
[TestCase("[ACX]Series Title 01 Episode Name [Kosaka] (9C57891E).mkv", "ACX", "9C57891E")]
[TestCase("[S-T-D] Series Title! - 06 (1280x720 10bit AAC) (59B3F2EA).mkv", "S-T-D", "59B3F2EA")]
[TestCase("[DHD] Series Title! - 08 (1280x720 10bit AAC) (8B8BF2EA).mkv", "DHD", "8B8BF2EA")]
[TestCase("[DHD] Series Title! - 10 (1280x720 10bit AAC) (10BBF2EA).mkv", "DHD", "10BBF2EA")]
public void should_parse_absolute_numbers_parenthesized_hash(string postTitle, string subGroup, string hash)
{
var result = Parser.Parser.ParseTitle(postTitle);

@ -492,7 +492,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly RegexReplace SimpleTitleRegex = new RegexReplace(@"(?:(480|540|576|720|1080|2160)[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*]|848x480|1280x720|1920x1080|3840x2160|4096x2160|(8|10)b(it)?|10-bit)\s*?",
private static readonly RegexReplace SimpleTitleRegex = new RegexReplace(@"(?:(480|540|576|720|1080|2160)[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*]|848x480|1280x720|1920x1080|3840x2160|4096x2160|(8|10)(b(?![a-z0-9])|bit)|10-bit)\s*?",
string.Empty,
RegexOptions.IgnoreCase | RegexOptions.Compiled);

Loading…
Cancel
Save