|
|
@ -47,10 +47,10 @@ namespace NzbDrone.Core.Parser
|
|
|
|
private static readonly Regex ProperRegex = new (@"\b(?<proper>proper)\b",
|
|
|
|
private static readonly Regex ProperRegex = new (@"\b(?<proper>proper)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex RepackRegex = new (@"\b(?<repack>repack|rerip)\b",
|
|
|
|
private static readonly Regex RepackRegex = new (@"\b(?<repack>repack\d?|rerip\d?)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex VersionRegex = new (@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]",
|
|
|
|
private static readonly Regex VersionRegex = new (@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",
|
|
|
|
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",
|
|
|
@ -706,24 +706,24 @@ namespace NzbDrone.Core.Parser
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = new QualityModel { Quality = Quality.Unknown };
|
|
|
|
var result = new QualityModel { Quality = Quality.Unknown };
|
|
|
|
|
|
|
|
|
|
|
|
if (ProperRegex.IsMatch(normalizedName))
|
|
|
|
var versionRegexResult = VersionRegex.Match(normalizedName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (versionRegexResult.Success)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result.Revision.Version = 2;
|
|
|
|
result.Revision.Version = Convert.ToInt32(versionRegexResult.Groups["version"].Value);
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (RepackRegex.IsMatch(normalizedName))
|
|
|
|
if (ProperRegex.IsMatch(normalizedName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result.Revision.Version = 2;
|
|
|
|
result.Revision.Version = versionRegexResult.Success ? Convert.ToInt32(versionRegexResult.Groups["version"].Value) + 1 : 2;
|
|
|
|
result.Revision.IsRepack = true;
|
|
|
|
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var versionRegexResult = VersionRegex.Match(normalizedName);
|
|
|
|
if (RepackRegex.IsMatch(normalizedName))
|
|
|
|
|
|
|
|
|
|
|
|
if (versionRegexResult.Success)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result.Revision.Version = Convert.ToInt32(versionRegexResult.Groups["version"].Value);
|
|
|
|
result.Revision.Version = versionRegexResult.Success ? Convert.ToInt32(versionRegexResult.Groups["version"].Value) + 1 : 2;
|
|
|
|
|
|
|
|
result.Revision.IsRepack = true;
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|