mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-24 06:27:08 -04:00
New: Parse ES as Spanish
This commit is contained in:
parent
4f47bb39ac
commit
0761e27cfa
3 changed files with 12 additions and 2 deletions
|
@ -76,6 +76,9 @@ namespace NzbDrone.Core.Test.ParserTests
|
|||
[TestCase("Movie Title (2016) [UHDRemux 2160p SDR] [Castellano DD 5.1 - Inglés DTS-HD MA 5.1 Subs]")]
|
||||
[TestCase("Movie Title 2022 [HDTV 720p][Cap.101][AC3 5.1 Castellano][www.pctnew.ORG]")]
|
||||
[TestCase("Movie Title 2022 [HDTV 720p][Cap.206][AC3 5.1 Español Castellano]")]
|
||||
[TestCase("Movie Title 2022 [Remux-1080p 8-bit h264 DTS-HD MA 2.0][ES.EN]-HiFi")]
|
||||
[TestCase("Movie Title 2022 [BDRemux 1080p AVC ES DTS-HD MA 5.1 Subs][HDO].mkv")]
|
||||
[TestCase("Movie.Name.2022.BluRay.1080p.H264.DTS[EN+ES].[EN+ES+IT]")]
|
||||
public void should_parse_language_spanish(string postTitle)
|
||||
{
|
||||
var result = Parser.Parser.ParseMovieTitle(postTitle, true);
|
||||
|
|
|
@ -258,6 +258,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|||
[TestCase("The.Good.German.2006.720p.HDTV.x264-TVP", Description = "The Good German is hardcoded not to match")]
|
||||
[TestCase("German.Lancers.2019.720p.BluRay.x264-UNiVERSUM", Description = "German at the beginning is never matched")]
|
||||
[TestCase("The.German.2019.720p.BluRay.x264-UNiVERSUM", Description = "The German is hardcoded not to match")]
|
||||
[TestCase("Movie Name (2016) BluRay 1080p DTS-ES AC3 x264-3Li", Description = "DTS-ES should not match ES (Spanish)")]
|
||||
public void should_not_parse_wrong_language_in_title(string postTitle)
|
||||
{
|
||||
var parsed = Parser.Parser.ParseMovieTitle(postTitle, true);
|
||||
|
|
|
@ -39,8 +39,9 @@ namespace NzbDrone.Core.Parser
|
|||
private static readonly Regex CaseSensitiveLanguageRegex = new Regex(@"(?:(?i)(?<!SUB[\W|_|^]))(?:(?<lithuanian>\bLT\b)|
|
||||
(?<czech>\bCZ\b)|
|
||||
(?<polish>\bPL\b)|
|
||||
(?<bulgarian>\bBG\b))(?:(?i)(?![\W|_|^]SUB))|
|
||||
(?<slovak>\bSK\b)",
|
||||
(?<bulgarian>\bBG\b)|
|
||||
(?<slovak>\bSK\b)|
|
||||
(?<spanish>\b(?<!DTS[._ -])ES\b))(?:(?i)(?![\W|_|^]SUB))",
|
||||
RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
private static readonly Regex GermanDualLanguageRegex = new (@"(?<!WEB[-_. ]?)\bDL\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
@ -261,6 +262,11 @@ namespace NzbDrone.Core.Parser
|
|||
{
|
||||
languages.Add(Language.Slovak);
|
||||
}
|
||||
|
||||
if (match.Groups["spanish"].Captures.Any())
|
||||
{
|
||||
languages.Add(Language.Spanish);
|
||||
}
|
||||
}
|
||||
|
||||
var matches = LanguageRegex.Matches(title);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue