#79: Added query parameter to randomize filename when downloading songs
Right now only the endpoint has this parameter added
This commit is contained in:
@@ -48,6 +48,14 @@ public class DirectoryManager : BaseManager
|
||||
|
||||
|
||||
#region Methods
|
||||
// Does not include extension
|
||||
public static string GenerateFilename(int length)
|
||||
{
|
||||
string chars = Constants.DirectoryPaths.FILENAME_CHARACTERS;
|
||||
var random = new Random();
|
||||
return new string(Enumerable.Repeat(chars, length).Select(s =>
|
||||
s[random.Next(s.Length)]).ToArray());
|
||||
}
|
||||
public void CreateDirectory()
|
||||
{
|
||||
CreateDirectory(_song);
|
||||
|
||||
Reference in New Issue
Block a user