diff --git a/src/NzbDrone.Core.Test/ParserTests/SubGroupParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SubGroupParserFixture.cs new file mode 100644 index 000000000..05c3f3a6a --- /dev/null +++ b/src/NzbDrone.Core.Test/ParserTests/SubGroupParserFixture.cs @@ -0,0 +1,19 @@ +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Test.Framework; + +namespace NzbDrone.Core.Test.ParserTests +{ + [TestFixture] + public class SubGroupParserFixture : CoreTest + { + [TestCase("[GHOST][1080p] Series - 25 [BD HEVC 10bit Dual Audio AC3][AE0ADDBA]", "GHOST")] + public void should_parse_sub_group_from_title_as_release_group(string title, string expected) + { + var result = Parser.Parser.ParseTitle(title); + + result.Should().NotBeNull(); + result.ReleaseGroup.Should().Be(expected); + } + } +} diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index fb6ea7210..16e02a906 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -86,7 +86,7 @@ namespace NzbDrone.Core.Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), // Anime - [SubGroup] Title with trailing 3-digit number and sub title - Absolute Episode Number - new Regex(@"^\[(?.+?)\][-_. ]?(?[^]]+?)(?:[-_. ]{3}?(?<absoluteepisode>\d{2}(\.\d{1,2})?(?!-?\d+|-[a-z]+)))+(?:[-_. ]+(?<special>special|ova|ovd))?.*?(?<hash>[(\[]\w{8}[)\]])?(?:$|\.mkv)", + new Regex(@"^\[(?<subgroup>[^\]]+?)\][-_. ]?(?<title>[^]]+?)(?:[-_. ]{3}?(?<absoluteepisode>\d{2}(\.\d{1,2})?(?!-?\d+|-[a-z]+)))+(?:[-_. ]+(?<special>special|ova|ovd))?.*?(?<hash>[(\[]\w{8}[)\]])?(?:$|\.mkv)", RegexOptions.IgnoreCase | RegexOptions.Compiled), // Anime - [SubGroup] Title with trailing number Absolute Episode Number