From a06a3fa5d6b841b491a8781b4a0ccac8d6a6cc49 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Tue, 20 Oct 2015 20:12:35 +0200 Subject: [PATCH] Fixed: Removal of common suffixes such as [ettv] while parsing. Fixes #874 --- .../ParserTests/SingleEpisodeParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index 140309f0a..f620115c4 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -111,6 +111,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Series Title Season 01 Episode 05 720p", "Series Title", 1, 5)] //[TestCase("Off the Air - 101 - Animals (460p.x264.vorbis-2.0) [449].mkv", "Off the Air", 1, 1)] [TestCase("The Young And the Restless - S42 E10713 - 2015-07-20.mp4", "The Young And the Restless", 42, 10713)] + [TestCase("quantico.103.hdtv-lol[ettv].mp4", "quantico", 1, 3)] //[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 e84a1afb0..9b025db86 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -203,6 +203,9 @@ namespace NzbDrone.Core.Parser private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(.*?[-._ ](S\d+E\d+)[-._ ])|-(RP|1|NZBGeek|sample)$", RegexOptions.IgnoreCase | RegexOptions.Compiled); + private static readonly Regex CleanTorrentSuffixRegex = new Regex(@"\[(?:ettv|rartv|rarbg|cttv)\]$", + RegexOptions.IgnoreCase | RegexOptions.Compiled); + private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?[a-z0-9]+)\b(?