New: Added Arabic language
This commit is contained in:
parent
33b708927c
commit
f8b8afdaa2
|
@ -232,6 +232,13 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
result.Language.Id.Should().Be(Language.Czech.Id);
|
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.S01E07.Cold.Action.HDTV.XviD-Droned")]
|
||||||
[TestCase("Russian.Puppets.S01E07E08.Cold.Action.HDTV.XviD-Droned")]
|
[TestCase("Russian.Puppets.S01E07E08.Cold.Action.HDTV.XviD-Droned")]
|
||||||
[TestCase("Russian.Puppets.S01.1080p.WEBRip.DDP5.1.x264-Drone")]
|
[TestCase("Russian.Puppets.S01.1080p.WEBRip.DDP5.1.x264-Drone")]
|
||||||
|
|
|
@ -81,6 +81,7 @@ namespace NzbDrone.Core.Languages
|
||||||
public static Language Hebrew { get { return new Language(23, "Hebrew"); } }
|
public static Language Hebrew { get { return new Language(23, "Hebrew"); } }
|
||||||
public static Language Lithuanian { get { return new Language(24, "Lithuanian"); } }
|
public static Language Lithuanian { get { return new Language(24, "Lithuanian"); } }
|
||||||
public static Language Czech { get { return new Language(25, "Czech"); } }
|
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
|
public static List<Language> All
|
||||||
|
@ -114,7 +115,8 @@ namespace NzbDrone.Core.Languages
|
||||||
Hungarian,
|
Hungarian,
|
||||||
Hebrew,
|
Hebrew,
|
||||||
Lithuanian,
|
Lithuanian,
|
||||||
Czech
|
Czech,
|
||||||
|
Arabic
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,8 @@ namespace NzbDrone.Core.Parser
|
||||||
new IsoLanguage("hu", "hun", Language.Hungarian),
|
new IsoLanguage("hu", "hun", Language.Hungarian),
|
||||||
new IsoLanguage("he", "heb", Language.Hebrew),
|
new IsoLanguage("he", "heb", Language.Hebrew),
|
||||||
new IsoLanguage("lt", "lit", Language.Lithuanian),
|
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)
|
public static IsoLanguage Find(string isoCode)
|
||||||
|
|
|
@ -93,6 +93,9 @@ namespace NzbDrone.Core.Parser
|
||||||
if (lowerTitle.Contains("hebrew"))
|
if (lowerTitle.Contains("hebrew"))
|
||||||
return Language.Hebrew;
|
return Language.Hebrew;
|
||||||
|
|
||||||
|
if (lowerTitle.Contains("arabic"))
|
||||||
|
return Language.Arabic;
|
||||||
|
|
||||||
var regexLanguage = RegexLanguage(title);
|
var regexLanguage = RegexLanguage(title);
|
||||||
|
|
||||||
if (regexLanguage != Language.Unknown)
|
if (regexLanguage != Language.Unknown)
|
||||||
|
|
Loading…
Reference in New Issue