mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 19:50:15 -07:00
CleanFileName when getting new filename from MediaFileProvider.
This commit is contained in:
parent
244e0f04f4
commit
208feb7d19
4 changed files with 23 additions and 13 deletions
|
@ -55,17 +55,5 @@ namespace NzbDrone.Core.Helpers
|
|||
return String.Format("{0} - S{1:00}E{2} - {3}", erm.SeriesName, erm.EpisodeFile.Episodes[0].SeasonNumber,
|
||||
epNumberString, epNameString);
|
||||
}
|
||||
|
||||
public static string CleanFilename(string name)
|
||||
{
|
||||
string result = name;
|
||||
string[] badCharacters = {"\\", "/", "<", ">", "?", "*", ":", "|", "\""};
|
||||
string[] goodCharacters = {"+", "+", "{", "}", "!", "@", "-", "#", "`"};
|
||||
|
||||
for (int i = 0; i < badCharacters.Length; i++)
|
||||
result = result.Replace(badCharacters[i], goodCharacters[i]);
|
||||
|
||||
return result.Trim();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue