#93: Initializing some properties in the song model earlier
This commit is contained in:
@@ -210,8 +210,10 @@ public class SongManager : BaseManager
|
|||||||
// Change the name of this method to only focus on wav files
|
// Change the name of this method to only focus on wav files
|
||||||
public void SaveSongToFileSystem(IFormFile songFile, IFormFile coverArtData, Song song)
|
public void SaveSongToFileSystem(IFormFile songFile, IFormFile coverArtData, Song song)
|
||||||
{
|
{
|
||||||
song.SongDirectory = _tempDirectoryRoot;
|
if (string.IsNullOrEmpty(song.SongDirectory))
|
||||||
song.DateCreated = DateTime.Now;
|
{
|
||||||
|
song.SongDirectory = _tempDirectoryRoot;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(song.Filename))
|
if (string.IsNullOrEmpty(song.Filename))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class SongDataController : BaseController
|
|||||||
var fileType = meta.FileExtensionType(tmpSong.SongPath());
|
var fileType = meta.FileExtensionType(tmpSong.SongPath());
|
||||||
song.Filename = tmpSong.Filename;
|
song.Filename = tmpSong.Filename;
|
||||||
song.SongDirectory = tmpSong.SongDirectory;
|
song.SongDirectory = tmpSong.SongDirectory;
|
||||||
|
song.DateCreated = tmpSong.DateCreated;
|
||||||
|
|
||||||
switch (fileType)
|
switch (fileType)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user