New: Add Arabic Language

Fixes #5883
pull/5895/head
Qstick 4 years ago
parent e64dd799e6
commit 6702c7d21b

@ -39,7 +39,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { 27, Language.Romanian }, new object[] { 27, Language.Romanian },
new object[] { 28, Language.Thai }, new object[] { 28, Language.Thai },
new object[] { 29, Language.Bulgarian }, new object[] { 29, Language.Bulgarian },
new object[] { 30, Language.PortugueseBR } new object[] { 30, Language.PortugueseBR },
new object[] { 31, Language.Arabic }
}; };
public static object[] ToIntCases = public static object[] ToIntCases =
@ -73,7 +74,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { Language.Romanian, 27 }, new object[] { Language.Romanian, 27 },
new object[] { Language.Thai, 28 }, new object[] { Language.Thai, 28 },
new object[] { Language.Bulgarian, 29 }, new object[] { Language.Bulgarian, 29 },
new object[] { Language.PortugueseBR, 30 } new object[] { Language.PortugueseBR, 30 },
new object[] { Language.Arabic, 31 }
}; };
[Test] [Test]

@ -287,6 +287,13 @@ namespace NzbDrone.Core.Test.ParserTests
result.Languages.Should().BeEquivalentTo(Language.Czech); result.Languages.Should().BeEquivalentTo(Language.Czech);
} }
[TestCase("Mosul.2019.ARABIC.WEBRip.x264-VXT")]
public void should_parse_language_arabic(string postTitle)
{
var result = Parser.Parser.ParseMovieTitle(postTitle);
result.Languages.Should().BeEquivalentTo(Language.Arabic);
}
[TestCase("Pulp Fiction.en.sub")] [TestCase("Pulp Fiction.en.sub")]
[TestCase("Pulp Fiction.eng.sub")] [TestCase("Pulp Fiction.eng.sub")]
[TestCase("Pulp.Fiction.eng.forced.sub")] [TestCase("Pulp.Fiction.eng.forced.sub")]

@ -101,6 +101,7 @@ namespace NzbDrone.Core.Languages
public static Language Thai => new Language(28, "Thai"); public static Language Thai => new Language(28, "Thai");
public static Language Bulgarian => new Language(29, "Bulgarian"); public static Language Bulgarian => new Language(29, "Bulgarian");
public static Language PortugueseBR => new Language(30, "Portuguese (Brazil)"); public static Language PortugueseBR => new Language(30, "Portuguese (Brazil)");
public static Language Arabic => new Language(31, "Arabic");
public static Language Any => new Language(-1, "Any"); public static Language Any => new Language(-1, "Any");
public static Language Original => new Language(-2, "Original"); public static Language Original => new Language(-2, "Original");
@ -141,6 +142,7 @@ namespace NzbDrone.Core.Languages
Thai, Thai,
Bulgarian, Bulgarian,
PortugueseBR, PortugueseBR,
Arabic,
Any, Any,
Original Original
}; };

@ -36,7 +36,8 @@ namespace NzbDrone.Core.Parser
new IsoLanguage("th", "", "tha", "Thai", Language.Thai), new IsoLanguage("th", "", "tha", "Thai", Language.Thai),
new IsoLanguage("bg", "", "bul", "Bulgarian", Language.Bulgarian), new IsoLanguage("bg", "", "bul", "Bulgarian", Language.Bulgarian),
new IsoLanguage("ro", "", "ron", "Romanian", Language.Romanian), new IsoLanguage("ro", "", "ron", "Romanian", Language.Romanian),
new IsoLanguage("pt", "br", "", "Portuguese (Brazil)", Language.PortugueseBR) new IsoLanguage("pt", "br", "", "Portuguese (Brazil)", Language.PortugueseBR),
new IsoLanguage("ar", "", "ara", "Arabic", Language.Arabic)
}; };
public static IsoLanguage Find(string isoCode) public static IsoLanguage Find(string isoCode)

@ -87,6 +87,11 @@ namespace NzbDrone.Core.Parser
languages.Add(Language.Hindi); languages.Add(Language.Hindi);
} }
if (lowerTitle.Contains("arabic"))
{
languages.Add(Language.Arabic);
}
if (lowerTitle.Contains("thai")) if (lowerTitle.Contains("thai"))
{ {
languages.Add(Language.Thai); languages.Add(Language.Thai);

Loading…
Cancel
Save