You've already forked Sonarr
mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-09-16 09:26:36 +02:00
Fixed: Sub group parsing could result in extra brackets being parsed
Closes #7994
This commit is contained in:
19
src/NzbDrone.Core.Test/ParserTests/SubGroupParserFixture.cs
Normal file
19
src/NzbDrone.Core.Test/ParserTests/SubGroupParserFixture.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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(@"^\[(?<subgroup>.+?)\][-_. ]?(?<title>[^]]+?)(?:[-_. ]{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
|
||||
|
Reference in New Issue
Block a user