Fixed: Detection of russian releases using 'rus' in the title

pull/4/head
Mark McDowall 11 years ago
parent a6c653651f
commit 54f01ce41d

@ -409,6 +409,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Burn.Notice.S04E15.Brotherly.Love.GERMAN.DUBBED.WS.WEBRiP.XviD.REPACK-TVP", Language.German)] [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("Ray Donovan - S01E01.720p.HDtv.x264-Evolve (NLsub)", Language.Norwegian)]
[TestCase("Shield,.The.1x13.Tueurs.De.Flics.FR.DVDRip.XviD", Language.French)] [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) public void parse_language(string postTitle, Language language)
{ {
var result = Parser.Parser.ParseTitle(postTitle); var result = Parser.Parser.ParseTitle(postTitle);

@ -108,7 +108,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex MultiPartCleanupRegex = new Regex(@"\(\d+\)$", RegexOptions.Compiled); 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); RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex YearInTitleRegex = new Regex(@"^(?<title>.+?)(?:\W|_)?(?<year>\d{4})", private static readonly Regex YearInTitleRegex = new Regex(@"^(?<title>.+?)(?:\W|_)?(?<year>\d{4})",
@ -148,7 +148,6 @@ namespace NzbDrone.Core.Parser
foreach (var regex in ReportTitleRegex) foreach (var regex in ReportTitleRegex)
{ {
var regexString = regex.ToString();
var match = regex.Matches(simpleTitle); var match = regex.Matches(simpleTitle);
if (match.Count != 0) if (match.Count != 0)
@ -467,6 +466,9 @@ namespace NzbDrone.Core.Parser
if (match.Groups["french"].Success) if (match.Groups["french"].Success)
return Language.French; return Language.French;
if (match.Groups["russian"].Success)
return Language.Russian;
return Language.English; return Language.English;
} }

Loading…
Cancel
Save