1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-25 17:27:59 +00:00

Treating FR as french, better parsing for weird DVD releases

This commit is contained in:
Mark McDowall 2013-08-31 20:01:46 -07:00
parent d1de6c1b2c
commit 561e78df8b
4 changed files with 8 additions and 2 deletions

View file

@ -353,6 +353,7 @@ public void parse_series_name(string postTitle, string title)
[TestCase("H.Polukatoikia.S03E13.Greek.PDTV.XviD-Ouzo", Language.Greek)]
[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)]
public void parse_language(string postTitle, Language language)
{
var result = Parser.Parser.ParseTitle(postTitle);

View file

@ -44,6 +44,7 @@ public class QualityParserFixture : CoreTest
new object[] { "WEEDS.S03E01-06.DUAL.XviD.Bluray.AC3.-HELLYWOOD.avi", false },
new object[] { "The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", false },
new object[] { "The.Girls.Next.Door.S03E06.DVD.Rip.XviD-WiDE", false },
new object[] { "the.shield.1x13.circles.ws.xvidvd-tns", false}
};
public static object[] Webdl480pCases =

View file

@ -74,7 +74,8 @@ 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)(?:\W|_)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex LanguageRegex = new Regex(@"(?:\W|_)(?<italian>ita|italian)|(?<german>german\b)|(?<flemish>flemish)|(?<greek>greek)|(?<french>(?:\W|_)FR)(?:\W|_)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
public static ParsedEpisodeInfo ParsePath(string path)
{
@ -312,6 +313,9 @@ private static Language ParseLanguage(string title)
if (match.Groups["greek"].Captures.Cast<Capture>().Any())
return Language.Greek;
if (match.Groups["french"].Success)
return Language.French;
return Language.English;
}

View file

@ -18,7 +18,7 @@ public class QualityParser
private static readonly Regex SourceRegex = new Regex(@"(?<bluray>BluRay)|
(?<webdl>WEB-DL|WEBDL|WEB\sDL|WEB\-DL|WebRip)|
(?<hdtv>HDTV)|
(?<bdrip>BDRiP)|(?<brrip>BRRip)|(?<dvd>\bDVD\b|DVDRip|NTSC|PAL)|
(?<bdrip>BDRiP)|(?<brrip>BRRip)|(?<dvd>\bDVD\b|DVDRip|NTSC|PAL|xvidvd)|
(?<dsr>WS\sDSR|WS_DSR|WS\.DSR|DSR)|(?<pdtv>PDTV)|(?<sdtv>SDTV)",
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);