public static void MergeAlbumsToGenre(string targetGenre, IList sourceAlbums) { IList albumIds = new ArrayList(sourceAlbums.Count); foreach (LibraryDataProviderListItem sourceAlbum in sourceAlbums) { albumIds.Add((int)sourceAlbum.GetProperty("LibraryId")); } ZuneQueryList tracksByAlbums = ZuneApplication.ZuneLibrary.GetTracksByAlbums(albumIds, null); int num1 = (int)tracksByAlbums.AddRef(); uint count = (uint)tracksByAlbums.Count; for (uint index = 0; index < count; ++index) { tracksByAlbums.SetFieldValue(index, 398U, targetGenre); } int num2 = (int)tracksByAlbums.Release(); tracksByAlbums.Dispose(); }
public static void MergeArtistsToArtist(string targetArtist, IList sourceArtists) { IList artistIds = new ArrayList(sourceArtists.Count); foreach (LibraryDataProviderListItem sourceArtist in sourceArtists) { artistIds.Add((int)sourceArtist.GetProperty("LibraryId")); } ZuneQueryList albumsByArtists = ZuneApplication.ZuneLibrary.GetAlbumsByArtists(artistIds, null); int num1 = (int)albumsByArtists.AddRef(); uint count = (uint)albumsByArtists.Count; for (uint index = 0; index < count; ++index) { albumsByArtists.SetFieldValue(index, 380U, targetArtist); } int num2 = (int)albumsByArtists.Release(); albumsByArtists.Dispose(); }