-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjusted output filename, added custom file naming (config.json)
- Loading branch information
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CoubDownload_Bridge.Utils | ||
{ | ||
public static class StringExtension | ||
{ | ||
public static string ReplaceVariables(this string replaceable, Tuple<string, string>[] vars) | ||
{ | ||
vars.ToList().ForEach(x => | ||
{ | ||
replaceable = string.Join(x.Item2, replaceable.Split(new string[] { $"%{x.Item1}%" }, StringSplitOptions.None)); | ||
}); | ||
return replaceable; | ||
} | ||
public static string SanitizeFilename(this string filename) | ||
{ | ||
return String.Concat(filename.Split(Path.GetInvalidFileNameChars())); | ||
} | ||
} | ||
} |