From a0ce2d7cdf70f5518ef3589a4803924c52b7f624 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 1 Dec 2018 21:16:41 -0800 Subject: [PATCH] New: Parse release in square brackets at end of file name Closes #966 --- .../ParserTests/ReleaseGroupParserFixture.cs | 3 ++- src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs index 91cf503a3..6b96bceda 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs @@ -22,13 +22,14 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("The Colbert Report - 2014-06-02 - Thomas Piketty.mkv", null)] [TestCase("Real Time with Bill Maher S12E17 May 23, 2014.mp4", null)] [TestCase("Reizen Waes - S01E08 - Transistri\u00EB, Zuid-Osseti\u00EB en Abchazi\u00EB SDTV.avi", null)] - [TestCase("Simpsons 10x11 - Wild Barts Cant Be Broken [rl].avi", null)] + [TestCase("Simpsons 10x11 - Wild Barts Cant Be Broken [rl].avi", "rl")] [TestCase("[ www.Torrenting.com ] - Revenge.S03E14.720p.HDTV.X264-DIMENSION", "DIMENSION")] [TestCase("Seed S02E09 HDTV x264-2HD [eztv]-[rarbg.com]", "2HD")] [TestCase("7s-atlantis-s02e01-720p.mkv", null)] [TestCase("The.Middle.S09E13.720p.HEVC.x265-MeGusta-Pre", "MeGusta")] [TestCase("Ghosted.S01E08.Haunted.Hayride.720p.AMZN.WEBRip.DDP5.1.x264-NTb-postbot", "NTb")] [TestCase("Ghosted.S01E08.Haunted.Hayride.720p.AMZN.WEBRip.DDP5.1.x264-NTb-xpost", "NTb")] + [TestCase("Series Title - S01E01 - Episode Title [RlsGroup]", "RlsGroup")] //[TestCase("", "")] public void should_parse_release_group(string title, string expected) { diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 741b3e781..2072ad409 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -317,7 +317,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex CleanQualityBracketsRegex = new Regex(@"\[[a-z0-9 ._-]+\]$", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?[a-z0-9]+)(?[a-z0-9]+)(?[a-z0-9]+)\]$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex AnimeReleaseGroupRegex = new Regex(@"^(?:\[(?(?!\s).+?(?