From 732c2fe12f0ac4d1bb46ba888f353121cc3e570f Mon Sep 17 00:00:00 2001 From: Stevie Robinson Date: Tue, 10 Oct 2023 05:39:26 +0200 Subject: [PATCH] Fixed: Parsing Spanish releases --- .../ParserTests/SingleEpisodeParserFixture.cs | 3 +++ src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index 4ebd0f1e1..c7f4eb389 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -161,6 +161,9 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Series-S07E12-31st_Century_Fox-[Bluray-1080p].mkv", "Series", 7, 12)] [TestCase("TheTitle-S12E13-3_Acts_of_God.mkv", "TheTitle", 12, 13)] [TestCase("Series Title - Temporada 2 [HDTV 720p][Cap.408]", "Series Title", 4, 8)] + [TestCase("Series Title [HDTV][Cap.104](website.com).avi", "Series Title", 1, 4)] + [TestCase("Series Title [HDTV][Cap.402](website.com).avi", "Series Title", 4, 2)] + [TestCase("Series Title [HDTV 720p][Cap.101](website.com).mkv", "Series Title", 1, 1)] // [TestCase("", "", 0, 0)] public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 789fba4f7..35880d0e9 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -363,7 +363,7 @@ namespace NzbDrone.Core.Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), // Spanish tracker releases - new Regex(@"^(?.+?)(?:[-_. ]+?Temporada.+?\[Cap[-_.])(?<season>(?<!\d+)\d{1,2})(?<episode>(?<!e|x)(?:[1-9][0-9]|[0][1-9]))(?:\])", + new Regex(@"^(?<title>.+?)(?:(?:[-_. ]+?Temporada.+?|\[.+?\])\[Cap[-_.])(?<season>(?<!\d+)\d{1,2})(?<episode>(?<!e|x)(?:[1-9][0-9]|[0][1-9]))(?:\])", RegexOptions.IgnoreCase | RegexOptions.Compiled), // Anime Range - Title Absolute Episode Number (ep01-12)