From 92b5822a391ec944a1a3bc83c7c377c4fb79fb29 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 7 Dec 2018 05:22:06 -0500 Subject: [PATCH] New: Remove Pre, postbot, xpost suffixes from release groups (#3220) --- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 3 ++- .../ParserTests/ReleaseGroupParserFixture.cs | 3 +++ src/NzbDrone.Core/Parser/Parser.cs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 71e1b1d39..82b77c0b2 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -43,7 +43,8 @@ public void should_remove_accents_from_title() [TestCase("To.Live.and.Die.in.L.A.1985.1080p.BluRay", "To Live and Die in L.A.")] [TestCase("A.I.Artificial.Intelligence.(2001)", "A.I. Artificial Intelligence")] [TestCase("A.Movie.Name.(1998)", "A Movie Name")] - [TestCase("Thor: The Dark World 2013", "Thor The Dark World")] + [TestCase("www.Torrenting.com - Revenge.2008.720p.X264-DIMENSION", "Revenge")] + [TestCase("Thor: The Dark World 2013", "Thor The Dark World")] [TestCase("Resident.Evil.The.Final.Chapter.2016", "Resident Evil The Final Chapter")] [TestCase("Der.Soldat.James.German.Bluray.FuckYou.Pso.Why.cant.you.follow.scene.rules.1998", "Der Soldat James")] [TestCase("Passengers.German.DL.AC3.Dubbed..BluRay.x264-PsO", "Passengers")] diff --git a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs index 064546491..0690e4d6e 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs @@ -26,6 +26,9 @@ public class ReleaseGroupParserFixture : CoreTest [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.720p.HEVC.x265-MeGusta-Pre", "MeGusta")] + [TestCase("Haunted.Hayride.2018.720p.WEBRip.DDP5.1.x264-NTb-postbot", "NTb")] + [TestCase("Haunted.Hayride.2018.720p.WEBRip.DDP5.1.x264-NTb-xpost", "NTb")] //[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 b296c2918..7a9b176d4 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -101,7 +101,7 @@ public static class Parser private static readonly Regex SimpleReleaseTitleRegex = new Regex(@"\s*(?:[<>?*:|])", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex WebsitePrefixRegex = new Regex(@"^\[\s*[a-z]+(\.[a-z]+)+\s*\][- ]*", + private static readonly Regex WebsitePrefixRegex = new Regex(@"^\[\s*[a-z]+(\.[a-z]+)+\s*\][- ]*|^www\.[a-z]+\.(?:com|net)[ -]*", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex AirDateRegex = new Regex(@"^(.*?)(?\d{4})[_.-](?[0-1][0-9])[_.-](?[0-3][0-9])|(?[0-1][0-9])[_.-](?[0-3][0-9])[_.-](?\d{4}))(?!\d)", @@ -110,7 +110,7 @@ public static class Parser private static readonly Regex SixDigitAirDateRegex = new Regex(@"(?<=[_.-])(?(?[1-9]\d{1})(?[0-1][0-9])(?[0-3][0-9]))(?=[_.-])", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(.*?[-._ ](S\d+E\d+)[-._ ])|(-(RP|1|NZBGeek|Obfuscated|sample))+$", + private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(.*?[-._ ](S\d+E\d+)[-._ ])|(-(RP|1|NZBGeek|Obfuscated|sample|Pre|postbot|xpost))+$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex CleanTorrentSuffixRegex = new Regex(@"\[(?:ettv|rartv|rarbg|cttv)\]$",