Fixed: Release group will not contain file extension

pull/4/head
Mark McDowall 11 years ago
parent a5a02ce90e
commit b29efa5823

@ -16,13 +16,11 @@ namespace NzbDrone.Api.Authentication
private readonly IConfigFileProvider _configFileProvider; private readonly IConfigFileProvider _configFileProvider;
private static readonly NzbDroneUser AnonymousUser = new NzbDroneUser { UserName = "Anonymous" }; private static readonly NzbDroneUser AnonymousUser = new NzbDroneUser { UserName = "Anonymous" };
public AuthenticationService(IConfigFileProvider configFileProvider) public AuthenticationService(IConfigFileProvider configFileProvider)
{ {
_configFileProvider = configFileProvider; _configFileProvider = configFileProvider;
} }
public IUserIdentity Validate(string username, string password) public IUserIdentity Validate(string username, string password)
{ {
if (!Enabled) if (!Enabled)

@ -474,5 +474,13 @@ namespace NzbDrone.Core.Test.ParserTests
{ {
Parser.Parser.ParseReleaseGroup(title).Should().Be(expected); 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");
}
} }
} }

@ -129,8 +129,11 @@ namespace NzbDrone.Core.Parser
if (result == null) if (result == null)
{ {
Logger.Warn("Unable to parse episode info from path {0}", path); Logger.Warn("Unable to parse episode info from path {0}", path);
return null;
} }
result.ReleaseGroup = ParseReleaseGroup(fileInfo.Name.Replace(fileInfo.Extension, ""));
return result; return result;
} }

Loading…
Cancel
Save