1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 18:02:44 +01:00

Fixed: Remove initial dot in filename (#4509)

This commit is contained in:
Fuochi 2023-02-06 03:22:07 +04:00 committed by GitHub
parent cbcf3d1058
commit bc838b74c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@ public class CleanFixture : CoreTest
{ {
[TestCase("Mission: Impossible - no [HDTV-720p]", [TestCase("Mission: Impossible - no [HDTV-720p]",
"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) public void CleanFileName(string name, string expectedName)
{ {
FileNameBuilder.CleanFileName(name).Should().Be(expectedName); FileNameBuilder.CleanFileName(name).Should().Be(expectedName);

View File

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