1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

New: Added Arabic language

This commit is contained in:
Taloth Saldono 2021-02-07 19:28:46 +01:00
parent 33b708927c
commit f8b8afdaa2
4 changed files with 16 additions and 3 deletions

View File

@ -232,6 +232,13 @@ public void should_parse_language_czech(string postTitle)
result.Language.Id.Should().Be(Language.Czech.Id);
}
[TestCase("Antinormal.S01.ARABIC.COMPLETE.720p.NF.WEBRip.x264-PTV")]
public void should_parse_language_arabic(string postTitle)
{
var result = Parser.Parser.ParseTitle(postTitle);
result.Language.Id.Should().Be(Language.Arabic.Id);
}
[TestCase("Russian.Puppets.S01E07.Cold.Action.HDTV.XviD-Droned")]
[TestCase("Russian.Puppets.S01E07E08.Cold.Action.HDTV.XviD-Droned")]
[TestCase("Russian.Puppets.S01.1080p.WEBRip.DDP5.1.x264-Drone")]

View File

@ -81,8 +81,9 @@ public override bool Equals(object obj)
public static Language Hebrew { get { return new Language(23, "Hebrew"); } }
public static Language Lithuanian { get { return new Language(24, "Lithuanian"); } }
public static Language Czech { get { return new Language(25, "Czech"); } }
public static Language Arabic { get { return new Language(26, "Arabic"); } }
public static List<Language> All
{
get
@ -114,7 +115,8 @@ public static List<Language> All
Hungarian,
Hebrew,
Lithuanian,
Czech
Czech,
Arabic
};
}
}

View File

@ -33,7 +33,8 @@ public static class IsoLanguages
new IsoLanguage("hu", "hun", Language.Hungarian),
new IsoLanguage("he", "heb", Language.Hebrew),
new IsoLanguage("lt", "lit", Language.Lithuanian),
new IsoLanguage("cs", "ces", Language.Czech)
new IsoLanguage("cs", "ces", Language.Czech),
new IsoLanguage("ar", "ara", Language.Arabic)
};
public static IsoLanguage Find(string isoCode)

View File

@ -93,6 +93,9 @@ public static Language ParseLanguage(string title, bool defaultToEnglish = true)
if (lowerTitle.Contains("hebrew"))
return Language.Hebrew;
if (lowerTitle.Contains("arabic"))
return Language.Arabic;
var regexLanguage = RegexLanguage(title);
if (regexLanguage != Language.Unknown)