New: Add Hindi and Romanian Languages

Fixes #3597
pull/5153/head
Qstick 4 years ago
parent 53eeee8b91
commit 2823099237

@ -115,6 +115,22 @@ namespace NzbDrone.Core.Test.ParserTests
result.Languages.Should().BeEquivalentTo(Language.Russian);
}
[TestCase("Pulp.Fiction.1994.Romanian.1080p.XviD-LOL")]
public void should_parse_language_romanian(string postTitle)
{
var result = Parser.Parser.ParseMovieTitle(postTitle, true);
result.Languages.Should().BeEquivalentTo(Language.Romanian);
}
[TestCase("Pulp.Fiction.1994.Hindi.1080p.XviD-LOL")]
public void should_parse_language_hindi(string postTitle)
{
var result = Parser.Parser.ParseMovieTitle(postTitle, true);
result.Languages.Should().BeEquivalentTo(Language.Hindi);
}
[TestCase("Pulp.Fiction.1994.Polish.1080p.XviD-LOL")]
public void should_parse_language_polish(string postTitle)
{

@ -96,6 +96,8 @@ namespace NzbDrone.Core.Languages
public static Language Hebrew => new Language(23, "Hebrew");
public static Language Lithuanian => new Language(24, "Lithuanian");
public static Language Czech => new Language(25, "Czech");
public static Language Hindi => new Language(26, "Hindi");
public static Language Romanian => new Language(27, "Romanian");
public static Language Any => new Language(-1, "Any");
public static Language Original => new Language(-2, "Original");
@ -131,6 +133,8 @@ namespace NzbDrone.Core.Languages
Hebrew,
Lithuanian,
Czech,
Romanian,
Hindi,
Any,
Original
};

@ -31,7 +31,9 @@ namespace NzbDrone.Core.Parser
new IsoLanguage("ko", "", "kor", "Korean", Language.Korean),
new IsoLanguage("hu", "", "hun", "Hungarian", Language.Hungarian),
new IsoLanguage("he", "", "heb", "Hebrew", Language.Hebrew),
new IsoLanguage("cs", "", "ces", "Czech", Language.Czech)
new IsoLanguage("cs", "", "ces", "Czech", Language.Czech),
new IsoLanguage("hi", "", "hin", "Hindi", Language.Hindi),
new IsoLanguage("ro", "", "ron", "Romanian", Language.Romanian)
};
public static IsoLanguage Find(string isoCode)

@ -77,6 +77,16 @@ namespace NzbDrone.Core.Parser
languages.Add(Language.Russian);
}
if (lowerTitle.Contains("romanian"))
{
languages.Add(Language.Romanian);
}
if (lowerTitle.Contains("hindi"))
{
languages.Add(Language.Hindi);
}
if (lowerTitle.Contains("polish"))
{
languages.Add(Language.Polish);

Loading…
Cancel
Save