Fix: Don't use scene name for tracks when track naming disabled (#646)

pull/652/head
ta264 6 years ago committed by Daniel Underwood
parent c8ef68283b
commit b9cc94aa46

@ -304,6 +304,17 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.Should().Be(Path.GetFileNameWithoutExtension(_trackFile.RelativePath)); .Should().Be(Path.GetFileNameWithoutExtension(_trackFile.RelativePath));
} }
[Test]
public void use_file_name_when_sceneName_is_not_null()
{
_namingConfig.RenameTracks = false;
_trackFile.RelativePath = "Linkin Park - 06 - Test";
_trackFile.SceneName = "SceneName";
Subject.BuildTrackFileName(new List<Track> { _track1 }, _artist, _album, _trackFile)
.Should().Be(Path.GetFileNameWithoutExtension(_trackFile.RelativePath));
}
[Test] [Test]
public void use_path_when_sceneName_and_relative_path_are_null() public void use_path_when_sceneName_and_relative_path_are_null()
{ {
@ -315,7 +326,6 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.Should().Be(Path.GetFileNameWithoutExtension(_trackFile.Path)); .Should().Be(Path.GetFileNameWithoutExtension(_trackFile.Path));
} }
[Test] [Test]
public void should_not_clean_track_title_if_there_is_only_one() public void should_not_clean_track_title_if_there_is_only_one()
{ {

@ -93,7 +93,7 @@ namespace NzbDrone.Core.Organizer
if (!namingConfig.RenameTracks) if (!namingConfig.RenameTracks)
{ {
return GetOriginalTitle(trackFile); return GetOriginalFileName(trackFile);
} }
if (namingConfig.StandardTrackFormat.IsNullOrWhiteSpace()) if (namingConfig.StandardTrackFormat.IsNullOrWhiteSpace())

Loading…
Cancel
Save