From e30f80d7d5f472835083bdb25cb49dec742ac01d Mon Sep 17 00:00:00 2001 From: amazing-username Date: Mon, 20 May 2019 08:57:24 -0400 Subject: [PATCH] Changes to the song's metadata reflect in the database. Now the location on the filesystem has to match the updated metadata. #37 --- Controllers/Managers/SongManager.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Controllers/Managers/SongManager.cs b/Controllers/Managers/SongManager.cs index caa0c9d..171c0ea 100644 --- a/Controllers/Managers/SongManager.cs +++ b/Controllers/Managers/SongManager.cs @@ -753,8 +753,17 @@ namespace Icarus.Controllers.Managers var info = string.Empty; - if ((string.IsNullOrEmpty(newAlbumTitle) || string.IsNullOrEmpty(newAlbumArtist) || - oldAlbumTitle.Equals(newAlbumTitle) || oldAlbumArtist.Equals(newAlbumArtist))) + if (string.IsNullOrEmpty(newAlbumArtist)) + { + newAlbumArtist = oldAlbumArtist; + } + if (string.IsNullOrEmpty(newAlbumTitle)) + { + newAlbumTitle = oldAlbumTitle; + } + + if ((string.IsNullOrEmpty(newAlbumTitle) && string.IsNullOrEmpty(newAlbumArtist) || + oldAlbumTitle.Equals(newAlbumTitle) && oldAlbumArtist.Equals(newAlbumArtist))) { _logger.Info("No change to the song's album"); return albumRecord;