Fixed: Parsing of new hashed release filenames (######_##.ext)

pull/2728/head
Mark McDowall 6 years ago
parent ca22a25842
commit 39a8d4f0d8

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@ -80,6 +80,13 @@ namespace NzbDrone.Core.Test.ParserTests
"The Good Wife",
Quality.HDTV720p,
"NZBgeek"
},
new object[]
{
@"C:\Test\Fargo.S03E04.1080p.WEB-DL.DD5.1.H264-RARBG\170424_26.mkv".AsOsAgnostic(),
"Fargo",
Quality.WEBDL1080p,
"RARBG"
}
};

@ -252,7 +252,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
private static readonly Regex[] RejectHashedReleasesRegex = new Regex[]
private static readonly Regex[] RejectHashedReleasesRegexes = new Regex[]
{
// Generic match for md5 and mixed-case hashes.
new Regex(@"^[0-9a-zA-Z]{32}", RegexOptions.Compiled),
@ -275,7 +275,10 @@ namespace NzbDrone.Core.Parser
new Regex(@"^abc$", RegexOptions.Compiled | RegexOptions.IgnoreCase),
//b00bs - Started appearing January 2015
new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase)
new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase),
// 170424_26 - Started appearing August 2018
new Regex(@"^\d{6}_\d{2}$"),
};
//Regex to detect whether the title was reversed.
@ -751,7 +754,7 @@ namespace NzbDrone.Core.Parser
var titleWithoutExtension = RemoveFileExtension(title);
if (RejectHashedReleasesRegex.Any(v => v.IsMatch(titleWithoutExtension)))
if (RejectHashedReleasesRegexes.Any(v => v.IsMatch(titleWithoutExtension)))
{
Logger.Debug("Rejected Hashed Release Title: " + title);
return false;

Loading…
Cancel
Save