|
|
|
@ -32,7 +32,8 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
private static readonly Regex CaseSensitiveLanguageRegex = new Regex(@"(?:(?i)(?<!SUB[\W|_|^]))(?:(?<lithuanian>\bLT\b)|
|
|
|
|
|
(?<czech>\bCZ\b)|
|
|
|
|
|
(?<polish>\bPL\b)|
|
|
|
|
|
(?<bulgarian>\bBG\b))(?:(?i)(?![\W|_|^]SUB))",
|
|
|
|
|
(?<bulgarian>\bBG\b))(?:(?i)(?![\W|_|^]SUB))|
|
|
|
|
|
(?<slovak>\bSK\b)",
|
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex SubtitleLanguageRegex = new Regex(".+?[-_. ](?<iso_code>[a-z]{2,3})(?:[-_. ]forced)?$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
@ -182,6 +183,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
languages.Add(Language.Bengali);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lowerTitle.Contains("slovak"))
|
|
|
|
|
{
|
|
|
|
|
languages.Add(Language.Slovak);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Case sensitive
|
|
|
|
|
var caseSensitiveMatch = CaseSensitiveLanguageRegex.Match(title);
|
|
|
|
|
|
|
|
|
@ -205,6 +211,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
languages.Add(Language.Bulgarian);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (caseSensitiveMatch.Groups["slovak"].Captures.Cast<Capture>().Any())
|
|
|
|
|
{
|
|
|
|
|
languages.Add(Language.Slovak);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var matches = LanguageRegex.Matches(title);
|
|
|
|
|
|
|
|
|
|
foreach (Match match in matches)
|
|
|
|
|