From 867746a7636fef571b30bd7c4e5db35f3e34b647 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 1 Dec 2014 18:27:53 -0800 Subject: [PATCH] Fixed: Importing "Backup_tvdbid" encrypted filenames --- src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs | 7 +++++++ .../ParserTests/SingleEpisodeParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs index 720ad8ad1..4922489e0 100644 --- a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs @@ -44,6 +44,13 @@ namespace NzbDrone.Core.Test.ParserTests "weeds", "DVD", "NZBgeek" + }, + new object[] + { + @"C:\Test\Deadwood.S02E12.1080p.BluRay.x264-SONARR\Backup_72023S02-12".AsOsAgnostic(), + "deadwood", + "Bluray-1080p", + "SONARR" } }; diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index aaac796d5..3626dca41 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -93,6 +93,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("NCIS.S010E16.720p.HDTV.X264-DIMENSION", "NCIS", 10, 16)] [TestCase("[ www.Torrenting.com ] - Revolution.2012.S02E17.720p.HDTV.X264-DIMENSION", "Revolution2012", 2, 17)] [TestCase("Revolution.2012.S02E18.720p.HDTV.X264-DIMENSION.mkv", "Revolution2012", 2, 18)] + [TestCase("Backup_72023S02-12.mkv", "Backup_72023", 2, 12)] //[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 9ab812caf..298da472f 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -129,7 +129,10 @@ namespace NzbDrone.Core.Parser new Regex(@"^[a-z0-9]{24}$", RegexOptions.Compiled), // Format seen on some NZBGeek releases - new Regex(@"^[A-Z]{11}\d{3}$", RegexOptions.Compiled) + new Regex(@"^[A-Z]{11}\d{3}$", RegexOptions.Compiled), + + //Backup filename (Unknown origins) + new Regex(@"^Backup_\d{5,}S\d{2}-\d{2}$", RegexOptions.Compiled) }; //Regex to detect whether the title was reversed.