public void RemoveAlbumFromDatabase(int albumId) { ZuneQueryList zuneQueryList = _zuneLibrary.GetTracksByAlbum(0, albumId, EQuerySortType.eQuerySortOrderAscending, (uint)SchemaMap.kiIndex_AlbumID); for (int i = 0; i < zuneQueryList.Count; i++) { var track = new ZuneQueryItem(zuneQueryList, i); //TODO: see if we can delete the actual album _zuneLibrary.DeleteMedia(new[] { track.ID }, EMediaTypes.eMediaTypeAudio, false); } _zuneLibrary.CleanupTransientMedia(); zuneQueryList.Dispose(); }