Finished API functionality for Genre and Year endpoints. #41 and #42. Working on refining the updating song api route that's part of the clean up issue. #37

This commit is contained in:
amazing-username
2019-05-18 02:09:59 -04:00
parent 30abf31877
commit 41398461be
5 changed files with 93 additions and 18 deletions
+23 -5
View File
@@ -95,6 +95,29 @@ namespace Icarus.Controllers.Managers
#region Methods
// TODO: This method should update the Song, Album, and Artist records in the database
public SongResult UpdateSong(Song song, MusicStoreContext songStore, AlbumStoreContext albumStore,
ArtistStoreContext artistStore, GenreStoreContext genreStore,
YearStoreContext yearStore)
{
var oldSongRecord = songStore.GetSong(song.Id);
song.SongPath = oldSongRecord.SongPath;
MetadataRetriever updateMetadata = new MetadataRetriever();
updateMetadata.UpdateMetadata(song, oldSongRecord);
var updatedSong = updateMetadata.UpdatedSongRecord;
// TODO: Add the following methods
// UpdateAlbumInDatabase(oldSongRecord, newSongRecord, albumStore)
// UpdateArtistInDatabase(oldSongRecord, newSongRecord, artistStore
// UpdateeGenreInDatabase(oldSongRecord, newSongRecord, genreStore)
// UpdateYearInDatabase(oldSongRecord, newSongRecord, yearStore)
// UpdateSongInDatabase(oldSongRecord, newSongRecord, songStore)
return new SongResult();
}
public bool DeleteSongFromFileSystem(Song songMetaData)
{
bool successful = false;
@@ -191,11 +214,6 @@ namespace Icarus.Controllers.Managers
Console.WriteLine($"An Error Occurred: {exMsg}");
}
}
// TODO: This method should update the Song, Album, and Artist records in the database
public void UpdateSong(Song song, MusicStoreContext songStore, AlbumStoreContext albumStore,
ArtistStoreContext artistStore)
{
}
public async Task SaveSong(SongData songData)
{