mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-06 00:16:41 +01:00
Fixed: Replace illegal characters even when renaming is disabled
(cherry picked from commit 4d8a4436810828494e99f0854cf6de3269668fe4)
This commit is contained in:
parent
fc010a5ea0
commit
0fdfbe1453
2 changed files with 16 additions and 2 deletions
|
|
@ -562,6 +562,20 @@ public void use_path_when_sceneName_and_relative_path_are_null()
|
|||
.Should().Be(Path.GetFileNameWithoutExtension(_trackFile.Path));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_replace_illegal_characters_when_renaming_is_disabled()
|
||||
{
|
||||
_namingConfig.RenameTracks = false;
|
||||
_namingConfig.ReplaceIllegalCharacters = true;
|
||||
_namingConfig.ColonReplacementFormat = ColonReplacementFormat.Smart;
|
||||
|
||||
_trackFile.SceneName = "Linkin.Park.06.FLAC:LOL";
|
||||
_trackFile.Path = "Linkin Park - 06 - Test";
|
||||
|
||||
Subject.BuildTrackFileName(new List<Track> { _track1 }, _artist, _album, _trackFile)
|
||||
.Should().Be("Linkin.Park.06.FLAC-LOL");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_clean_track_title_if_there_is_only_one()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -661,10 +661,10 @@ private string GetOriginalTitle(TrackFile trackFile)
|
|||
{
|
||||
if (trackFile.SceneName.IsNullOrWhiteSpace())
|
||||
{
|
||||
return GetOriginalFileName(trackFile);
|
||||
return CleanFileName(GetOriginalFileName(trackFile));
|
||||
}
|
||||
|
||||
return trackFile.SceneName;
|
||||
return CleanFileName(trackFile.SceneName);
|
||||
}
|
||||
|
||||
private string GetOriginalFileName(TrackFile trackFile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue