mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
parent
e28bea14b3
commit
37c1b5b28c
@ -139,6 +139,15 @@ public void should_parse_language_thai(string postTitle)
|
||||
result.Languages.Should().BeEquivalentTo(Language.Thai);
|
||||
}
|
||||
|
||||
[TestCase("Pulp.Fiction.1994.Bulgarian.1080p.XviD-LOL")]
|
||||
[TestCase("Pulp.Fiction.1994.BGAUDIO.1080p.XviD-LOL")]
|
||||
public void should_parse_language_bulgarian(string postTitle)
|
||||
{
|
||||
var result = Parser.Parser.ParseMovieTitle(postTitle, true);
|
||||
|
||||
result.Languages.Should().BeEquivalentTo(Language.Bulgarian);
|
||||
}
|
||||
|
||||
[TestCase("Pulp.Fiction.1994.Polish.1080p.XviD-LOL")]
|
||||
public void should_parse_language_polish(string postTitle)
|
||||
{
|
||||
|
@ -99,6 +99,7 @@ public override bool Equals(object obj)
|
||||
public static Language Hindi => new Language(26, "Hindi");
|
||||
public static Language Romanian => new Language(27, "Romanian");
|
||||
public static Language Thai => new Language(28, "Thai");
|
||||
public static Language Bulgarian => new Language(29, "Bulgarian");
|
||||
public static Language Any => new Language(-1, "Any");
|
||||
public static Language Original => new Language(-2, "Original");
|
||||
|
||||
@ -137,6 +138,7 @@ public static List<Language> All
|
||||
Romanian,
|
||||
Hindi,
|
||||
Thai,
|
||||
Bulgarian,
|
||||
Any,
|
||||
Original
|
||||
};
|
||||
|
@ -34,6 +34,7 @@ public static class IsoLanguages
|
||||
new IsoLanguage("cs", "", "ces", "Czech", Language.Czech),
|
||||
new IsoLanguage("hi", "", "hin", "Hindi", Language.Hindi),
|
||||
new IsoLanguage("th", "", "tha", "Thai", Language.Thai),
|
||||
new IsoLanguage("bg", "", "bul", "Bulgarian", Language.Bulgarian),
|
||||
new IsoLanguage("ro", "", "ron", "Romanian", Language.Romanian)
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ public static class LanguageParser
|
||||
{
|
||||
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(LanguageParser));
|
||||
|
||||
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_|^)(?<italian>\b(?:ita|italian)\b)|(?<german>\b(?:german|videomann|ger)\b)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)(?:FR|VO|VFF|VFQ|VFI|VF2|TRUEFRENCH)(?:\W|_))|(?<russian>\brus\b)|(?<english>\beng\b)|(?<hungarian>\b(?:HUNDUB|HUN)\b)|(?<hebrew>\bHebDub\b)|(?<chinese>\[(?:CH[ST]|BIG5|GB)\]|简|繁|字幕)",
|
||||
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_|^)(?<italian>\b(?:ita|italian)\b)|(?<german>\b(?:german|videomann|ger)\b)|(?<flemish>flemish)|(?<bulgarian>bgaudio)|(?<greek>greek)|(?<french>(?:\W|_)(?:FR|VO|VFF|VFQ|VFI|VF2|TRUEFRENCH)(?:\W|_))|(?<russian>\brus\b)|(?<english>\beng\b)|(?<hungarian>\b(?:HUNDUB|HUN)\b)|(?<hebrew>\bHebDub\b)|(?<chinese>\[(?:CH[ST]|BIG5|GB)\]|简|繁|字幕)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex CaseSensitiveLanguageRegex = new Regex(@"(?<lithuanian>\bLT\b)|(?<czech>\bCZ\b)",
|
||||
@ -92,6 +92,11 @@ public static List<Language> ParseLanguages(string title)
|
||||
languages.Add(Language.Thai);
|
||||
}
|
||||
|
||||
if (lowerTitle.Contains("bulgarian"))
|
||||
{
|
||||
languages.Add(Language.Bulgarian);
|
||||
}
|
||||
|
||||
if (lowerTitle.Contains("polish"))
|
||||
{
|
||||
languages.Add(Language.Polish);
|
||||
@ -189,6 +194,11 @@ public static List<Language> ParseLanguages(string title)
|
||||
languages.Add(Language.English);
|
||||
}
|
||||
|
||||
if (match.Groups["bulgarian"].Success)
|
||||
{
|
||||
languages.Add(Language.Bulgarian);
|
||||
}
|
||||
|
||||
if (match.Groups["dutch"].Success)
|
||||
{
|
||||
languages.Add(Language.Dutch);
|
||||
|
Loading…
Reference in New Issue
Block a user