Song uploads

Uploading songs is functional and does not use the song metadata for the filename or directory creation
This commit is contained in:
kdeng00
2021-12-25 21:36:42 -05:00
parent 64e6f33d7c
commit b529731c95
9 changed files with 105 additions and 77 deletions
+13
View File
@@ -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
}
}