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:
parent
cbcf3d1058
commit
bc838b74c7
@ -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);
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user