diff --git a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs index 654b3e908..bb767f224 100644 --- a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs +++ b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs @@ -39,7 +39,8 @@ namespace NzbDrone.Core.Test.Languages new object[] { 27, Language.Romanian }, new object[] { 28, Language.Thai }, new object[] { 29, Language.Bulgarian }, - new object[] { 30, Language.PortugueseBR } + new object[] { 30, Language.PortugueseBR }, + new object[] { 31, Language.Arabic } }; public static object[] ToIntCases = @@ -73,7 +74,8 @@ namespace NzbDrone.Core.Test.Languages new object[] { Language.Romanian, 27 }, new object[] { Language.Thai, 28 }, new object[] { Language.Bulgarian, 29 }, - new object[] { Language.PortugueseBR, 30 } + new object[] { Language.PortugueseBR, 30 }, + new object[] { Language.Arabic, 31 } }; [Test] diff --git a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs index 94da98cf4..24b0acc00 100644 --- a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs @@ -287,6 +287,13 @@ namespace NzbDrone.Core.Test.ParserTests 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.eng.sub")] [TestCase("Pulp.Fiction.eng.forced.sub")] diff --git a/src/NzbDrone.Core/Languages/Language.cs b/src/NzbDrone.Core/Languages/Language.cs index 735d5c62c..1a634e6d6 100644 --- a/src/NzbDrone.Core/Languages/Language.cs +++ b/src/NzbDrone.Core/Languages/Language.cs @@ -101,6 +101,7 @@ namespace NzbDrone.Core.Languages public static Language Thai => new Language(28, "Thai"); public static Language Bulgarian => new Language(29, "Bulgarian"); 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 Original => new Language(-2, "Original"); @@ -141,6 +142,7 @@ namespace NzbDrone.Core.Languages Thai, Bulgarian, PortugueseBR, + Arabic, Any, Original }; diff --git a/src/NzbDrone.Core/Parser/IsoLanguages.cs b/src/NzbDrone.Core/Parser/IsoLanguages.cs index da55d2b4e..b0493dd7b 100644 --- a/src/NzbDrone.Core/Parser/IsoLanguages.cs +++ b/src/NzbDrone.Core/Parser/IsoLanguages.cs @@ -36,7 +36,8 @@ namespace NzbDrone.Core.Parser new IsoLanguage("th", "", "tha", "Thai", Language.Thai), new IsoLanguage("bg", "", "bul", "Bulgarian", Language.Bulgarian), 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) diff --git a/src/NzbDrone.Core/Parser/LanguageParser.cs b/src/NzbDrone.Core/Parser/LanguageParser.cs index 90f8b3ae9..4b28fe264 100644 --- a/src/NzbDrone.Core/Parser/LanguageParser.cs +++ b/src/NzbDrone.Core/Parser/LanguageParser.cs @@ -87,6 +87,11 @@ namespace NzbDrone.Core.Parser languages.Add(Language.Hindi); } + if (lowerTitle.Contains("arabic")) + { + languages.Add(Language.Arabic); + } + if (lowerTitle.Contains("thai")) { languages.Add(Language.Thai);