Updated Entity Framework to 2.2.6, Removed PrintCredentials() Method call on login, working on #55
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
@@ -92,6 +93,8 @@ namespace Icarus.Controllers.Managers
|
|||||||
_logger.Error(msg, "An error occurred");
|
_logger.Error(msg, "An error occurred");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[DllImport("libicarus.so")]
|
||||||
|
public static extern void create_directory(SongManager.Sng song);
|
||||||
public void DeleteEmptyDirectories()
|
public void DeleteEmptyDirectories()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@@ -364,7 +365,12 @@ namespace Icarus.Controllers.Managers
|
|||||||
DirectoryManager dirMgr = new DirectoryManager(_config, song);
|
DirectoryManager dirMgr = new DirectoryManager(_config, song);
|
||||||
dirMgr.CreateDirectory();
|
dirMgr.CreateDirectory();
|
||||||
|
|
||||||
|
var sng = ConvertSongToSng(song);
|
||||||
|
|
||||||
|
DirectoryManager.create_directory(sng);
|
||||||
|
|
||||||
System.IO.File.Delete(fileTempPath);
|
System.IO.File.Delete(fileTempPath);
|
||||||
|
Environment.Exit(1);
|
||||||
|
|
||||||
var filePath = dirMgr.SongDirectory;
|
var filePath = dirMgr.SongDirectory;
|
||||||
var songFilename = songFile.FileName;
|
var songFilename = songFile.FileName;
|
||||||
@@ -501,6 +507,18 @@ namespace Icarus.Controllers.Managers
|
|||||||
return song;
|
return song;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Sng ConvertSongToSng(Song song)
|
||||||
|
{
|
||||||
|
return new Sng
|
||||||
|
{
|
||||||
|
Id = song.Id,
|
||||||
|
Title = song.Title,
|
||||||
|
Artist = song.Artist,
|
||||||
|
Album = song.AlbumTitle,
|
||||||
|
Genre = song.Genre,
|
||||||
|
Year = song.Year.Value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private Song RetrieveMetaData(string filePath)
|
private Song RetrieveMetaData(string filePath)
|
||||||
{
|
{
|
||||||
@@ -1219,5 +1237,19 @@ namespace Icarus.Controllers.Managers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Structs
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct Sng
|
||||||
|
{
|
||||||
|
public int Id;
|
||||||
|
public string Title;
|
||||||
|
public string Artist;
|
||||||
|
public string Album;
|
||||||
|
public string Genre;
|
||||||
|
public int Year;
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ namespace Icarus.Controllers.Managers
|
|||||||
_audience = _config["Auth0:ApiIdentifier"];
|
_audience = _config["Auth0:ApiIdentifier"];
|
||||||
_grantType = "client_credentials";
|
_grantType = "client_credentials";
|
||||||
_url = $"https://{_config["Auth0:Domain"]}";
|
_url = $"https://{_config["Auth0:Domain"]}";
|
||||||
|
|
||||||
PrintCredentials();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Testing Methods
|
#region Testing Methods
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.3">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
project(icarus)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(SOURCES
|
||||||
|
src/icarus.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(icarus SHARED ${SOURCES})
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
constexpr auto app_setting = "appsettings.Development.json";
|
||||||
|
|
||||||
|
struct Song
|
||||||
|
{
|
||||||
|
int Id;
|
||||||
|
char *Title;
|
||||||
|
char *Artist;
|
||||||
|
char *Album;
|
||||||
|
char *Genre;
|
||||||
|
int Year;
|
||||||
|
};
|
||||||
|
|
||||||
|
void create_directory_process(Song);
|
||||||
|
|
||||||
|
void create_directory_process(Song song)
|
||||||
|
{
|
||||||
|
auto curr_path = fs::current_path();
|
||||||
|
std::cout<<"current path "<<curr_path.string()<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
|
||||||
|
void create_directory(Song);
|
||||||
|
void print_song_details(const Song);
|
||||||
|
|
||||||
|
void create_directory(Song song)
|
||||||
|
{
|
||||||
|
std::cout<<"c++ creating directory"<<std::endl;
|
||||||
|
print_song_details(song);
|
||||||
|
create_directory_process(song);
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_song_details(const Song song)
|
||||||
|
{
|
||||||
|
std::cout<<"song details"<<std::endl;
|
||||||
|
std::cout<<"title: "<<song.Title<<std::endl;
|
||||||
|
std::cout<<"artist: "<<song.Artist<<std::endl;
|
||||||
|
std::cout<<"album: "<<song.Album<<std::endl;
|
||||||
|
std::cout<<"genre: "<<song.Genre<<std::endl;
|
||||||
|
std::cout<<"year: "<<song.Year<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user