New: Add Malayalam and Kannada languages

pull/10372/head
Bogdan 3 months ago
parent 2d4846e5be
commit 453f216e0d

@ -59,7 +59,9 @@ namespace NzbDrone.Core.Test.Languages
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 @@ namespace NzbDrone.Core.Test.Languages
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]

@ -419,6 +419,23 @@ namespace NzbDrone.Core.Test.ParserTests
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")]

@ -57,6 +57,10 @@ namespace NzbDrone.Core.ImportLists.TMDb
[FieldOption(Hint = "Macedonian")]
mk,
[FieldOption(Hint = "Slovenian")]
sl
sl,
[FieldOption(Hint = "Malayalam")]
ml,
[FieldOption(Hint = "Kannada")]
kn
}
}

@ -118,6 +118,8 @@ namespace NzbDrone.Core.Languages
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 @@ namespace NzbDrone.Core.Languages
Telugu,
Macedonian,
Slovenian,
Malayalam,
Kannada,
Any,
Original
};

@ -57,6 +57,8 @@ namespace NzbDrone.Core.Parser
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<string, Language> AlternateIsoCodeMappings = new ()

@ -217,6 +217,16 @@ namespace NzbDrone.Core.Parser
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);

Loading…
Cancel
Save