Song uploads
Uploading songs is functional and does not use the song metadata for the filename or directory creation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -58,6 +59,18 @@ namespace Icarus.Models
|
||||
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
public string GenerateFilename()
|
||||
{
|
||||
const int length = 25;
|
||||
const string chars = "ABCDEF0123456789";
|
||||
var random = new Random();
|
||||
var filename = new string(Enumerable.Repeat(chars, length).Select(s =>
|
||||
s[random.Next(s.Length)]).ToArray());
|
||||
var extension = ".mp3";
|
||||
|
||||
return $"{filename}{extension}";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user