Fixed: Correctly handle Repack Releases

This commit is contained in:
Qstick
2019-05-04 23:50:00 -04:00
parent 23316329ed
commit 2f1290d488
22 changed files with 673 additions and 72 deletions
+10 -2
View File
@@ -13,7 +13,10 @@ namespace NzbDrone.Core.Parser
{
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
private static readonly Regex ProperRegex = new Regex(@"\b(?<proper>proper|repack|rerip)\b",
private static readonly Regex ProperRegex = new Regex(@"\b(?<proper>proper)\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex RepackRegex = new Regex(@"\b(?<repack>repack|rerip)\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex VersionRegex = new Regex(@"\dv(?<version>\d)\b|\[v(?<version>\d)\]",
@@ -286,6 +289,12 @@ namespace NzbDrone.Core.Parser
result.Revision.Version = 2;
}
if (RepackRegex.IsMatch(normalizedName))
{
result.Revision.Version = 2;
result.Revision.IsRepack = true;
}
Match versionRegexResult = VersionRegex.Match(normalizedName);
if (versionRegexResult.Success)
@@ -294,7 +303,6 @@ namespace NzbDrone.Core.Parser
}
//TODO: re-enable this when we have a reliable way to determine real
//TODO: Only treat it as a real if it comes AFTER the season/epsiode number
MatchCollection realRegexResult = RealRegex.Matches(name);
if (realRegexResult.Count > 0)