diff --git a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs index da77d5f42..11d381383 100644 --- a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs +++ b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs @@ -59,7 +59,9 @@ public class LanguageFixture : CoreTest new object[] { 44, Language.Indonesian }, new object[] { 45, Language.Telugu }, new object[] { 46, Language.Macedonian }, - new object[] { 47, Language.Slovenian } + new object[] { 47, Language.Slovenian }, + new object[] { 48, Language.Malayalam }, + new object[] { 49, Language.Kannada } }; public static object[] ToIntCases = @@ -113,7 +115,9 @@ public class LanguageFixture : CoreTest new object[] { Language.Indonesian, 44 }, new object[] { Language.Telugu, 45 }, new object[] { Language.Macedonian, 46 }, - new object[] { Language.Slovenian, 47 } + new object[] { Language.Slovenian, 47 }, + new object[] { Language.Malayalam, 48 }, + new object[] { Language.Kannada, 49 } }; [Test] diff --git a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs index d4996761e..33c2cf53c 100644 --- a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs @@ -419,6 +419,23 @@ public void should_parse_language_catalan(string postTitle) result.Languages.Should().Contain(Language.Catalan); } + [TestCase("Movie Title (2024) Malayalam BRRip 1080p x264 DTS 5.1 E-subs-MBRHDRG")] + [TestCase("Movie.Title.2024.Malayalam.1080p.AMZN.WEB-DL.DD+5.1.H.264-Shadow.BonsaiHD")] + [TestCase("Movie.Title.2024.2160p.Malayalam.WEB-DL.H.265.SDR.DDP5.1-NbT")] + public void should_parse_language_malayalam(string postTitle) + { + var result = LanguageParser.ParseLanguages(postTitle); + result.Should().Contain(Language.Malayalam); + } + + [TestCase("Movie Title (2024) Kannada 1080p HD AVC MP4 x264 .9.8GB TEAMTR")] + [TestCase("Movie.Title.2024.Kannada.1080p.AMZN.WEB-DL.DD+2.0.x264-Telly")] + public void should_parse_language_kannada(string postTitle) + { + var result = LanguageParser.ParseLanguages(postTitle); + result.Should().Contain(Language.Kannada); + } + [TestCase("Movie.Title.en.sub")] [TestCase("Movie Title.eng.sub")] [TestCase("Movie.Title.eng.forced.sub")] diff --git a/src/NzbDrone.Core/ImportLists/TMDb/TMDbLanguageCodes.cs b/src/NzbDrone.Core/ImportLists/TMDb/TMDbLanguageCodes.cs index ee3eca6c1..596d1cf57 100644 --- a/src/NzbDrone.Core/ImportLists/TMDb/TMDbLanguageCodes.cs +++ b/src/NzbDrone.Core/ImportLists/TMDb/TMDbLanguageCodes.cs @@ -57,6 +57,10 @@ public enum TMDbLanguageCodes [FieldOption(Hint = "Macedonian")] mk, [FieldOption(Hint = "Slovenian")] - sl + sl, + [FieldOption(Hint = "Malayalam")] + ml, + [FieldOption(Hint = "Kannada")] + kn } } diff --git a/src/NzbDrone.Core/Languages/Language.cs b/src/NzbDrone.Core/Languages/Language.cs index 0684a7391..9aa5d034d 100644 --- a/src/NzbDrone.Core/Languages/Language.cs +++ b/src/NzbDrone.Core/Languages/Language.cs @@ -118,6 +118,8 @@ public override bool Equals(object obj) public static Language Telugu => new Language(45, "Telugu"); public static Language Macedonian => new Language(46, "Macedonian"); public static Language Slovenian => new Language(47, "Slovenian"); + public static Language Malayalam => new Language(48, "Malayalam"); + public static Language Kannada => new Language(49, "Kannada"); public static Language Any => new Language(-1, "Any"); public static Language Original => new Language(-2, "Original"); @@ -175,6 +177,8 @@ public static List All Telugu, Macedonian, Slovenian, + Malayalam, + Kannada, Any, Original }; diff --git a/src/NzbDrone.Core/Parser/IsoLanguages.cs b/src/NzbDrone.Core/Parser/IsoLanguages.cs index a3b40d48b..b16c3cb39 100644 --- a/src/NzbDrone.Core/Parser/IsoLanguages.cs +++ b/src/NzbDrone.Core/Parser/IsoLanguages.cs @@ -57,6 +57,8 @@ public static class IsoLanguages new IsoLanguage("te", "", "tel", "Telugu", Language.Telugu), new IsoLanguage("mk", "", "mkd", "Macedonian", Language.Macedonian), new IsoLanguage("sl", "", "slv", "Slovenian", Language.Slovenian), + new IsoLanguage("ml", "", "mal", "Malayalam", Language.Malayalam), + new IsoLanguage("kn", "", "kan", "Kannada", Language.Kannada), }; private static readonly Dictionary AlternateIsoCodeMappings = new () diff --git a/src/NzbDrone.Core/Parser/LanguageParser.cs b/src/NzbDrone.Core/Parser/LanguageParser.cs index e1574805e..5609067ad 100644 --- a/src/NzbDrone.Core/Parser/LanguageParser.cs +++ b/src/NzbDrone.Core/Parser/LanguageParser.cs @@ -217,6 +217,16 @@ public static List ParseLanguages(string title) languages.Add(Language.Telugu); } + if (lowerTitle.Contains("malayalam")) + { + languages.Add(Language.Malayalam); + } + + if (lowerTitle.Contains("kannada")) + { + languages.Add(Language.Kannada); + } + // Case sensitive var caseSensitiveMatches = CaseSensitiveLanguageRegex.Matches(title);