Directories are created using C++ when a song is uploaded
This commit is contained in:
@@ -38,6 +38,7 @@ namespace Icarus.Controllers.Managers
|
||||
coverArt);
|
||||
|
||||
song.CoverArtId = coverArt.CoverArtId;
|
||||
_logger.Info("Cover art Process saving complete");
|
||||
}
|
||||
public void DeleteCoverArtFromDatabase(CoverArt coverArt,
|
||||
CoverArtRepository coverArtRepository)
|
||||
@@ -122,6 +123,14 @@ namespace Icarus.Controllers.Managers
|
||||
Console.WriteLine("Copied Stock Cover Art");
|
||||
}
|
||||
}
|
||||
#region Testing
|
||||
private void PrintCoverArtDetails(CoverArt cover)
|
||||
{
|
||||
Console.WriteLine("\nCover art");
|
||||
Console.WriteLine($"Song Title: {cover.SongTitle}");
|
||||
Console.WriteLine($"ImagePath: {cover.ImagePath}\n");
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
@@ -94,7 +95,8 @@ namespace Icarus.Controllers.Managers
|
||||
}
|
||||
}
|
||||
[DllImport("libicarus.so")]
|
||||
public static extern void create_directory(SongManager.Sng song);
|
||||
public static extern void create_directory(SongManager.Sng song, string root_path, StringBuilder created_dir);
|
||||
//public static extern void create_directory(SongManager.Sng song, string root_path, string created_dir);
|
||||
public void DeleteEmptyDirectories()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Configuration;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -362,17 +363,21 @@ namespace Icarus.Controllers.Managers
|
||||
var song = await SaveSongTemp(songFile, fileTempPath);
|
||||
song.SongPath = fileTempPath;
|
||||
|
||||
DirectoryManager dirMgr = new DirectoryManager(_config, song);
|
||||
dirMgr.CreateDirectory();
|
||||
|
||||
var sng = ConvertSongToSng(song);
|
||||
|
||||
DirectoryManager.create_directory(sng);
|
||||
var rootPath = _config.GetValue<string>("RootMusicPath");
|
||||
var strCount = rootPath.Length + song.Artist.Length +
|
||||
song.AlbumTitle.Length + 2;
|
||||
|
||||
var filePathSB = new StringBuilder(strCount);
|
||||
|
||||
DirectoryManager.create_directory(sng,
|
||||
rootPath, filePathSB);
|
||||
|
||||
var filePath = filePathSB.ToString().Substring(0, strCount);
|
||||
|
||||
System.IO.File.Delete(fileTempPath);
|
||||
Environment.Exit(1);
|
||||
|
||||
var filePath = dirMgr.SongDirectory;
|
||||
|
||||
var songFilename = songFile.FileName;
|
||||
|
||||
if (!songFilename.EndsWith(".mp3"))
|
||||
|
||||
Reference in New Issue
Block a user