Cover art functionality added. Left TODO's on where to continue on. #50

This commit is contained in:
amazing-username
2019-07-12 23:13:32 -04:00
parent 226ca44206
commit 026a528a81
6 changed files with 110 additions and 33 deletions
+11 -12
View File
@@ -68,6 +68,14 @@ namespace Icarus.Controllers.V1
_genreRepository = HttpContext
.RequestServices
.GetService(typeof(GenreRepository)) as GenreRepository;
_yearRepository = HttpContext
.RequestServices
.GetService(typeof(YearRepository)) as YearRepository;
_coverArtRepository = HttpContext
.RequestServices
.GetService(typeof(CoverArtRepository)) as CoverArtRepository;
}
@@ -76,9 +84,8 @@ namespace Icarus.Controllers.V1
[Authorize("download:songs")]
public async Task<IActionResult> Get(int id)
{
SongRepository context = HttpContext.RequestServices
.GetService(typeof(SongRepository)) as SongRepository;
var songMetaData = context.GetSong(id);
Initialize();
var songMetaData = _songRepository.GetSong(id);
SongData song = await _songMgr.RetrieveSong(songMetaData);
@@ -93,14 +100,6 @@ namespace Icarus.Controllers.V1
{
Initialize();
YearRepository yearStore = HttpContext.RequestServices
.GetService(typeof(YearRepository)) as YearRepository;
CoverArtRepository coverArtRepository = HttpContext
.RequestServices
.GetService
(typeof(CoverArtRepository)) as CoverArtRepository;
Console.WriteLine("Uploading song...");
_logger.LogInformation("Uploading song...");
@@ -114,7 +113,7 @@ namespace Icarus.Controllers.V1
await _songMgr.SaveSongToFileSystem(sng, _songRepository,
_albumRepository, _artistRepository,
_genreRepository, yearStore, coverArtRepository);
_genreRepository, _yearRepository, _coverArtRepository);
}
}
catch (Exception ex)