diff --git a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs index 50830ac95..e1f3dae23 100644 --- a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs @@ -416,6 +416,10 @@ public void should_parse_language_spanish_latino(string postTitle) } [TestCase("Movie.Title.1994.Catalan.1080p.XviD-LOL")] + [TestCase("Movie.Title.2024.Catalán.1080p.XviD-LOL")] + [TestCase("Movie.Title.(2024).(Catala.Spanish.Subs).WEBRip.1080p.x264-EAC3")] + [TestCase("Movie.Title.(2024).(Spanish.Catala.English.Subs).BDRip.1080p.x264-EAC3")] + [TestCase("Movie Title [2024] [BDrip 1080p-x264-AC3 5.1 català-español-english+sub]")] public void should_parse_language_catalan(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle, true); diff --git a/src/NzbDrone.Core/Parser/LanguageParser.cs b/src/NzbDrone.Core/Parser/LanguageParser.cs index 0abdc249c..5fcf8acda 100644 --- a/src/NzbDrone.Core/Parser/LanguageParser.cs +++ b/src/NzbDrone.Core/Parser/LanguageParser.cs @@ -31,6 +31,7 @@ public static class LanguageParser (?\[(?:CH[ST]|BIG5|GB)\]|简|繁|字幕)| (?(?:(?:\dx)?UKR))| (?\b(?:español|castellano)\b)| + (?\b(?:catalan?|catalán|català)\b)| (?\b(?:lat|lav|lv)\b)| (?\btel\b)| (?\bVIE\b)", @@ -208,11 +209,6 @@ public static List ParseLanguages(string title) languages.Add(Language.SpanishLatino); } - if (lowerTitle.Contains("catalan")) - { - languages.Add(Language.Catalan); - } - if (lowerTitle.Contains("tamil")) { languages.Add(Language.Tamil); @@ -348,6 +344,11 @@ public static List ParseLanguages(string title) languages.Add(Language.Spanish); } + if (match.Groups["catalan"].Success) + { + languages.Add(Language.Catalan); + } + if (match.Groups["ukrainian"].Success) { languages.Add(Language.Ukrainian);