From b29efa58237da3ce94b74a87fedb253a637f3441 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 25 Dec 2013 23:16:13 -0800 Subject: [PATCH] Fixed: Release group will not contain file extension --- src/NzbDrone.Api/Authentication/AuthenticationService.cs | 2 -- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 8 ++++++++ src/NzbDrone.Core/Parser/Parser.cs | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Api/Authentication/AuthenticationService.cs b/src/NzbDrone.Api/Authentication/AuthenticationService.cs index af9194c8d..b71b7a07e 100644 --- a/src/NzbDrone.Api/Authentication/AuthenticationService.cs +++ b/src/NzbDrone.Api/Authentication/AuthenticationService.cs @@ -16,13 +16,11 @@ namespace NzbDrone.Api.Authentication private readonly IConfigFileProvider _configFileProvider; private static readonly NzbDroneUser AnonymousUser = new NzbDroneUser { UserName = "Anonymous" }; - public AuthenticationService(IConfigFileProvider configFileProvider) { _configFileProvider = configFileProvider; } - public IUserIdentity Validate(string username, string password) { if (!Enabled) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 7da18d33d..ea35b5445 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -474,5 +474,13 @@ namespace NzbDrone.Core.Test.ParserTests { Parser.Parser.ParseReleaseGroup(title).Should().Be(expected); } + + [Test] + public void should_not_include_extension_in_releaseGroup() + { + const string path = @"C:\Test\Doctor.Who.2005.s01e01.internal.bdrip.x264-archivist.mkv"; + + Parser.Parser.ParsePath(path).ReleaseGroup.Should().Be("archivist"); + } } } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 593e349d9..7797a61cd 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -129,8 +129,11 @@ namespace NzbDrone.Core.Parser if (result == null) { Logger.Warn("Unable to parse episode info from path {0}", path); + return null; } + result.ReleaseGroup = ParseReleaseGroup(fileInfo.Name.Replace(fileInfo.Extension, "")); + return result; }