|
|
|
@ -121,6 +121,9 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
private static readonly Regex AirDateRegex = new Regex(@"^(.*?)(?<!\d)((?<airyear>\d{4})[_.-](?<airmonth>[0-1][0-9])[_.-](?<airday>[0-3][0-9])|(?<airmonth>[0-1][0-9])[_.-](?<airday>[0-3][0-9])[_.-](?<airyear>\d{4}))(?!\d)",
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+)\b(?<!WEB-DL|480p|720p|1080p)",
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>\bita\b|italian)|(?<german>german\b)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)FR)(?:\W|_)|(?<russian>\brus\b)",
|
|
|
|
@ -281,24 +284,13 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
title = title.TrimEnd("-RP");
|
|
|
|
|
|
|
|
|
|
var index = title.LastIndexOf('-');
|
|
|
|
|
|
|
|
|
|
if (index < 0)
|
|
|
|
|
index = title.LastIndexOf(' ');
|
|
|
|
|
|
|
|
|
|
if (index < 0)
|
|
|
|
|
return defaultReleaseGroup;
|
|
|
|
|
|
|
|
|
|
var group = title.Substring(index + 1);
|
|
|
|
|
|
|
|
|
|
if (group.Length == title.Length)
|
|
|
|
|
return String.Empty;
|
|
|
|
|
|
|
|
|
|
group = group.Trim('-', ' ', '[', ']');
|
|
|
|
|
|
|
|
|
|
if (group.ToLower() == "480p" ||
|
|
|
|
|
group.ToLower() == "720p" ||
|
|
|
|
|
group.ToLower() == "1080p")
|
|
|
|
|
string group;
|
|
|
|
|
var matches = ReleaseGroupRegex.Matches(title);
|
|
|
|
|
if (matches.Count != 0)
|
|
|
|
|
{
|
|
|
|
|
group = matches.OfType<Match>().Last().Groups["releasegroup"].Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return defaultReleaseGroup;
|
|
|
|
|
}
|
|
|
|
|