Fixed: Remove initial dot in filename (#4509)

pull/8070/head
Fuochi 2 years ago committed by GitHub
parent cbcf3d1058
commit bc838b74c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,6 +10,8 @@ namespace NzbDrone.Core.Test.OrganizerTests
{
[TestCase("Mission: Impossible - no [HDTV-720p]",
"Mission Impossible - no [HDTV-720p]")]
[TestCase(".45 (2006)", "45 (2006)")]
[TestCase(" The Movie Title ", "The Movie Title")]
public void CleanFileName(string name, string expectedName)
{
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);

@ -233,7 +233,7 @@ namespace NzbDrone.Core.Organizer
result = result.Replace(badCharacters[i], replace ? goodCharacters[i] : string.Empty);
}
return result.Trim();
return result.TrimStart(' ', '.').TrimEnd(' ');
}
public static string CleanFolderName(string name)

Loading…
Cancel
Save