New: Add Marathi language

pull/10809/head
Siddhant Naik 2 weeks ago committed by Bogdan
parent 0e25b2708c
commit 25f66a3029

@ -63,7 +63,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { 48, Language.Malayalam },
new object[] { 49, Language.Kannada },
new object[] { 50, Language.Albanian },
new object[] { 51, Language.Afrikaans }
new object[] { 51, Language.Afrikaans },
new object[] { 52, Language.Marathi }
};
public static object[] ToIntCases =
@ -121,7 +122,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { Language.Malayalam, 48 },
new object[] { Language.Kannada, 49 },
new object[] { Language.Albanian, 50 },
new object[] { Language.Afrikaans, 51 }
new object[] { Language.Afrikaans, 51 },
new object[] { Language.Marathi, 52 }
};
[Test]

@ -62,5 +62,14 @@ namespace NzbDrone.Core.Test.ParserTests
var result = IsoLanguages.Find(isoCode);
result.Language.Should().Be(Language.Afrikaans);
}
[TestCase("mr")]
[TestCase("mar")]
[TestCase("mr-IN")]
public void should_return_marathi(string isoCode)
{
var result = IsoLanguages.Find(isoCode);
result.Language.Should().Be(Language.Marathi);
}
}
}

@ -460,6 +460,14 @@ namespace NzbDrone.Core.Test.ParserTests
result.Should().Contain(Language.Afrikaans);
}
[TestCase("Movie Title 2015 Marathi 1080p WebRip x264 AC3 5.1 ESubs [TMB]")]
[TestCase("Movie.Title.(2018).720p.CensorRip.Marathi.x264.AAC.-.LHDm@Telly")]
public void should_parse_language_marathi(string postTitle)
{
var result = LanguageParser.ParseLanguages(postTitle);
result.Should().Contain(Language.Marathi);
}
[TestCase("Movie.Title.en.sub")]
[TestCase("Movie Title.eng.sub")]
[TestCase("Movie.Title.eng.forced.sub")]

@ -65,6 +65,8 @@ namespace NzbDrone.Core.ImportLists.TMDb
[FieldOption(Hint = "Albanian")]
sq,
[FieldOption(Hint = "Afrikaans")]
af
af,
[FieldOption(Hint = "Marathi")]
mr
}
}

@ -122,6 +122,7 @@ namespace NzbDrone.Core.Languages
public static Language Kannada => new Language(49, "Kannada");
public static Language Albanian => new Language(50, "Albanian");
public static Language Afrikaans => new Language(51, "Afrikaans");
public static Language Marathi => new Language(52, "Marathi");
public static Language Any => new Language(-1, "Any");
public static Language Original => new Language(-2, "Original");
@ -183,6 +184,7 @@ namespace NzbDrone.Core.Languages
Kannada,
Albanian,
Afrikaans,
Marathi,
Any,
Original
};

@ -61,6 +61,7 @@ namespace NzbDrone.Core.Parser
new IsoLanguage("kn", "", "kan", "Kannada", Language.Kannada),
new IsoLanguage("sq", "", "sqi", "Albanian", Language.Albanian),
new IsoLanguage("af", "", "afr", "Afrikaans", Language.Afrikaans),
new IsoLanguage("mr", "", "mar", "Marathi", Language.Marathi),
};
private static readonly Dictionary<string, Language> AlternateIsoCodeMappings = new ()

@ -239,6 +239,11 @@ namespace NzbDrone.Core.Parser
languages.Add(Language.Afrikaans);
}
if (lowerTitle.Contains("marathi"))
{
languages.Add(Language.Marathi);
}
// Case sensitive
var caseSensitiveMatches = CaseSensitiveLanguageRegex.Matches(title);

Loading…
Cancel
Save