mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Detection of russian releases using 'rus' in the title
This commit is contained in:
parent
a6c653651f
commit
54f01ce41d
@ -409,6 +409,7 @@ public void parse_series_name(string postTitle, string title)
|
||||
[TestCase("Burn.Notice.S04E15.Brotherly.Love.GERMAN.DUBBED.WS.WEBRiP.XviD.REPACK-TVP", Language.German)]
|
||||
[TestCase("Ray Donovan - S01E01.720p.HDtv.x264-Evolve (NLsub)", Language.Norwegian)]
|
||||
[TestCase("Shield,.The.1x13.Tueurs.De.Flics.FR.DVDRip.XviD", Language.French)]
|
||||
[TestCase("True.Detective.S01E01.1080p.WEB-DL.Rus.Eng.TVKlondike", Language.Russian)]
|
||||
public void parse_language(string postTitle, Language language)
|
||||
{
|
||||
var result = Parser.Parser.ParseTitle(postTitle);
|
||||
|
@ -108,7 +108,7 @@ public static class Parser
|
||||
|
||||
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>ita|italian)|(?<german>german\b)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)FR)(?:\W|_)",
|
||||
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>ita|italian)|(?<german>german\b)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)FR)(?:\W|_)|(?<russian>\brus\b)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex YearInTitleRegex = new Regex(@"^(?<title>.+?)(?:\W|_)?(?<year>\d{4})",
|
||||
@ -148,7 +148,6 @@ public static ParsedEpisodeInfo ParseTitle(string title)
|
||||
|
||||
foreach (var regex in ReportTitleRegex)
|
||||
{
|
||||
var regexString = regex.ToString();
|
||||
var match = regex.Matches(simpleTitle);
|
||||
|
||||
if (match.Count != 0)
|
||||
@ -467,6 +466,9 @@ private static Language ParseLanguage(string title)
|
||||
if (match.Groups["french"].Success)
|
||||
return Language.French;
|
||||
|
||||
if (match.Groups["russian"].Success)
|
||||
return Language.Russian;
|
||||
|
||||
return Language.English;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user