|
|
|
@ -91,6 +91,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex ReportImdbId = new Regex(@"(?<imdbid>tt\d{7,8})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
private static readonly Regex ReportTmdbId = new Regex(@"tmdb(id)?-(?<tmdbid>\d+)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
private static readonly RegexReplace SimpleTitleRegex = new RegexReplace(@"\s*(?:480[ip]|576[ip]|720[ip]|1080[ip]|2160[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*:|]|848x480|1280x720|1920x1080|(8|10)b(it)?)",
|
|
|
|
|
string.Empty,
|
|
|
|
@ -274,6 +275,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
result.SimpleReleaseTitle = simpleReleaseTitle;
|
|
|
|
|
|
|
|
|
|
result.ImdbId = ParseImdbId(simpleReleaseTitle);
|
|
|
|
|
result.TmdbId = ParseTmdbId(simpleReleaseTitle);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -315,6 +317,20 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int ParseTmdbId(string title)
|
|
|
|
|
{
|
|
|
|
|
var match = ReportTmdbId.Match(title);
|
|
|
|
|
if (match.Success)
|
|
|
|
|
{
|
|
|
|
|
if (match.Groups["tmdbid"].Value != null)
|
|
|
|
|
{
|
|
|
|
|
return int.TryParse(match.Groups["tmdbid"].Value, out var tmdbId) ? tmdbId : 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ParseEdition(string languageTitle)
|
|
|
|
|
{
|
|
|
|
|
var editionMatch = ReportEditionRegex.Match(languageTitle);
|
|
|
|
@ -522,8 +538,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
movieName = movieName.Trim(' ');
|
|
|
|
|
|
|
|
|
|
int airYear;
|
|
|
|
|
int.TryParse(matchCollection[0].Groups["year"].Value, out airYear);
|
|
|
|
|
int.TryParse(matchCollection[0].Groups["year"].Value, out var airYear);
|
|
|
|
|
|
|
|
|
|
ParsedMovieInfo result;
|
|
|
|
|
|
|
|
|
|