New: Download Clients for Manual Grabs

This commit is contained in:
Qstick
2021-03-18 00:07:25 -04:00
parent fd27018caa
commit 881313ef2b
209 changed files with 12229 additions and 127 deletions
+20
View File
@@ -12,6 +12,26 @@ namespace NzbDrone.Core.Parser
{
public static class StringUtil
{
public static string CleanFileName(string name, bool replace = true)
{
string result = name;
string[] badCharacters = { "\\", "/", "<", ">", "?", "*", ":", "|", "\"" };
string[] goodCharacters = { "+", "+", "", "", "!", "-", "-", "", "" };
// Replace a colon followed by a space with space dash space for a better appearance
if (replace)
{
result = result.Replace(": ", " - ");
}
for (int i = 0; i < badCharacters.Length; i++)
{
result = result.Replace(badCharacters[i], replace ? goodCharacters[i] : string.Empty);
}
return result.TrimStart(' ', '.').TrimEnd(' ');
}
/*
public static string StripNonAlphaNumeric(this string str, string replacement = "") =>
StripRegex(str, "[^a-zA-Z0-9 -]", replacement);