public UpdateResults UpdateTrack(DBTrackInfo mv) { if (mv == null) { return(UpdateResults.FAILED); } lock (LockList) { DBArtistInfo db1 = DBArtistInfo.Get(mv); if (db1 != null) { mv.ArtistInfo[0] = db1; } if (mv.ArtistInfo.Count > 0) { mv.ArtistInfo[0].PrimarySource = mv.PrimarySource; mv.ArtistInfo[0].Commit(); } DBAlbumInfo db2 = DBAlbumInfo.Get(mv); if (db2 != null) { mv.AlbumInfo[0] = db2; } if (mv.AlbumInfo.Count > 0) { foreach (DBAlbumInfo db3 in mv.AlbumInfo) { db3.PrimarySource = mv.PrimarySource; db3.Commit(); } } } return(UpdateResults.SUCCESS); }
public UpdateResults UpdateTrack(DBTrackInfo mv) { // Have we anything to update? if (mv == null) { return(UpdateResults.FAILED); } logger.Debug("In Method: UpdateTrack(DBTrackInfo mv)"); lock (lockObj) { // Update the Artist var artistData = DBArtistInfo.Get(mv); if (artistData != null) { mv.ArtistInfo[0] = artistData; } if (mv.ArtistInfo.Count > 0) { mv.ArtistInfo[0].PrimarySource = mv.PrimarySource; mv.ArtistInfo[0].Commit(); } // Update the Album var albumData = DBAlbumInfo.Get(mv); if (albumData != null) { mv.AlbumInfo[0] = albumData; } if (mv.AlbumInfo.Count > 0) { mv.AlbumInfo[0].PrimarySource = mv.PrimarySource; mv.AlbumInfo[0].Commit(); } } return(UpdateResults.SUCCESS); }