#93: Cleanup
This commit is contained in:
@@ -252,7 +252,6 @@ public class SongManager : BaseManager
|
|||||||
return song;
|
return song;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Needs to be implemented
|
|
||||||
public Song SaveFlacSongToFileSystem(IFormFile songFile, IFormFile coverArtData, Song song)
|
public Song SaveFlacSongToFileSystem(IFormFile songFile, IFormFile coverArtData, Song song)
|
||||||
{
|
{
|
||||||
// Save temp song (Should already be saved to the filesystem by the time it gets to this method)
|
// Save temp song (Should already be saved to the filesystem by the time it gets to this method)
|
||||||
@@ -360,16 +359,7 @@ public class SongManager : BaseManager
|
|||||||
_logger.Info("Saving temp song: {0}", songPath);
|
_logger.Info("Saving temp song: {0}", songPath);
|
||||||
await songFile.CopyToAsync(filestream);
|
await songFile.CopyToAsync(filestream);
|
||||||
}
|
}
|
||||||
// For audio files that already contain embedded metadata
|
|
||||||
/*
|
|
||||||
await Task.Run(() =>
|
|
||||||
{
|
|
||||||
MetadataRetriever meta = new MetadataRetriever();
|
|
||||||
song = meta.RetrieveMetaData(song.SongPath());
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
// song.SongDirectory = _tempDirectoryRoot;
|
|
||||||
song.DateCreated = DateTime.Now;
|
song.DateCreated = DateTime.Now;
|
||||||
|
|
||||||
return song;
|
return song;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// using Ionic.Zip;
|
|
||||||
|
|
||||||
using Icarus.Models;
|
using Icarus.Models;
|
||||||
|
|
||||||
namespace Icarus.Controllers.Utilities;
|
namespace Icarus.Controllers.Utilities;
|
||||||
@@ -73,14 +71,6 @@ public class SongCompression
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
var f = new Ionic.Zlib.ZlibStream();
|
|
||||||
using (ZipFile zip = new ZipFile())
|
|
||||||
{
|
|
||||||
zip.AddFile(songDetails.SongPath());
|
|
||||||
zip.Save(tmpZipFilePath);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
Console.WriteLine("Successfully compressed");
|
Console.WriteLine("Successfully compressed");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,17 +81,14 @@ public class SongDataController : BaseController
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Console.WriteLine("Uploading song...");
|
|
||||||
_logger!.LogInformation("Uploading song...");
|
_logger!.LogInformation("Uploading song...");
|
||||||
|
|
||||||
var uploads = _songTempDir;
|
var uploads = _songTempDir;
|
||||||
// Console.WriteLine($"Song Root Path {uploads}");
|
|
||||||
_logger!.LogInformation($"Song root path {uploads}");
|
_logger!.LogInformation($"Song root path {uploads}");
|
||||||
|
|
||||||
foreach (var sng in songData)
|
foreach (var sng in songData)
|
||||||
if (sng.Length > 0)
|
if (sng.Length > 0)
|
||||||
{
|
{
|
||||||
// Console.WriteLine($"Song filename {sng.FileName}");
|
|
||||||
_logger!.LogInformation($"Song filename {sng.FileName}");
|
_logger!.LogInformation($"Song filename {sng.FileName}");
|
||||||
|
|
||||||
_songMgr!.SaveSongToFileSystem(sng).Wait();
|
_songMgr!.SaveSongToFileSystem(sng).Wait();
|
||||||
@@ -154,12 +151,9 @@ public class SongDataController : BaseController
|
|||||||
switch (song.AudioType)
|
switch (song.AudioType)
|
||||||
{
|
{
|
||||||
case "wav":
|
case "wav":
|
||||||
// TODO: Identify the song file type. Then save the media.
|
|
||||||
// Create a new method to save song flac files
|
|
||||||
song = _songMgr.SaveSongToFileSystem(up.SongData, up.CoverArtData, song);
|
song = _songMgr.SaveSongToFileSystem(up.SongData, up.CoverArtData, song);
|
||||||
break;
|
break;
|
||||||
case "flac":
|
case "flac":
|
||||||
// TODO: Skeleton method
|
|
||||||
song = _songMgr.SaveFlacSongToFileSystem(up.SongData, up.CoverArtData, song);
|
song = _songMgr.SaveFlacSongToFileSystem(up.SongData, up.CoverArtData, song);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user