|
|
@ -11,7 +11,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(LanguageParser));
|
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(LanguageParser));
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>\b(?:ita|italian)\b)|(?<german>german\b|videomann)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)(?:FR|VOSTFR)(?:\W|_))|(?<russian>\brus\b)|(?<dutch>nl\W?subs?)|(?<hungarian>\b(?:HUNDUB|HUN)\b)",
|
|
|
|
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>\b(?:ita|italian)\b)|(?<german>german\b|videomann)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)(?:FR|VOSTFR)(?:\W|_))|(?<russian>\brus\b)|(?<dutch>nl\W?subs?)|(?<hungarian>\b(?:HUNDUB|HUN)\b)|(?<hebrew>\bHebDub\b)",
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Regex SubtitleLanguageRegex = new Regex(".+?[-_. ](?<iso_code>[a-z]{2,3})$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
private static readonly Regex SubtitleLanguageRegex = new Regex(".+?[-_. ](?<iso_code>[a-z]{2,3})$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
@ -77,6 +77,9 @@ namespace NzbDrone.Core.Parser
|
|
|
|
if (lowerTitle.Contains("hungarian"))
|
|
|
|
if (lowerTitle.Contains("hungarian"))
|
|
|
|
return Language.Hungarian;
|
|
|
|
return Language.Hungarian;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lowerTitle.Contains("hebrew"))
|
|
|
|
|
|
|
|
return Language.Hebrew;
|
|
|
|
|
|
|
|
|
|
|
|
var match = LanguageRegex.Match(title);
|
|
|
|
var match = LanguageRegex.Match(title);
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["italian"].Captures.Cast<Capture>().Any())
|
|
|
|
if (match.Groups["italian"].Captures.Cast<Capture>().Any())
|
|
|
@ -103,6 +106,9 @@ namespace NzbDrone.Core.Parser
|
|
|
|
if (match.Groups["hungarian"].Success)
|
|
|
|
if (match.Groups["hungarian"].Success)
|
|
|
|
return Language.Hungarian;
|
|
|
|
return Language.Hungarian;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.Groups["hebrew"].Success)
|
|
|
|
|
|
|
|
return Language.Hebrew;
|
|
|
|
|
|
|
|
|
|
|
|
return Language.English;
|
|
|
|
return Language.English;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|