/// <summary>Migrate the metadata from one file to another.</summary> /// <param name="source">The source editor.></param> /// <param name="destination">The destination editor.</param> /// <param name="augmentMetadata">Whether to augment the metadata for WMP and MCE.</param> /// <returns>The migrated collection.</returns> public static IDictionary MigrateMetadata(MetadataEditor source, MetadataEditor destination, bool augmentMetadata) { IDictionary metadata = source.GetAttributes(); // Augment the metadata to provide a better experience in both WMP and MCE if (augmentMetadata) { string title = GetMetadataItemAsString(metadata, MetadataEditor.Title); string subTitle = GetMetadataItemAsString(metadata, MetadataEditor.Subtitle); if (!title.EndsWith(subTitle)) { title += (title.Length > 0 && subTitle.Length > 0 ? " - " : string.Empty) + subTitle; } SetMetadataItemAsString(metadata, MetadataEditor.Title, title); CopyMetadataItem(metadata, MetadataEditor.SubtitleDescription, metadata, MetadataEditor.Description); CopyMetadataItem(metadata, MetadataEditor.Credits, metadata, MetadataEditor.Author); CopyMetadataItem(metadata, MetadataEditor.Title, metadata, MetadataEditor.AlbumTitle); CopyMetadataItem(metadata, MetadataEditor.StationName, metadata, MetadataEditor.Composer); CopyMetadataItem(metadata, MetadataEditor.ParentalRating, metadata, MetadataEditor.ContentGroupDescription); CopyMetadataItem(metadata, MetadataEditor.MediaOriginalBroadcastDateTime, metadata, MetadataEditor.PartOfSet); CopyMetadataItem(metadata, MetadataEditor.ParentalRating, metadata, MetadataEditor.Mood); } // Set the metadata onto the destination file destination.SetAttributes(metadata); return metadata; }
/// <summary>Migrate the metadata from one file to another.</summary> /// <param name="source">The source editor.></param> /// <param name="destination">The destination editor.</param> /// <returns>The migrated collection.</returns> public static IDictionary MigrateMetadata(MetadataEditor source, MetadataEditor destination) { return(MigrateMetadata(source, destination, false)); }
/// <summary>Migrate the metadata from one file to another.</summary> /// <param name="source">The source editor.></param> /// <param name="destination">The destination editor.</param> /// <returns>The migrated collection.</returns> public static IDictionary MigrateMetadata(MetadataEditor source, MetadataEditor destination) { return MigrateMetadata(source, destination, false); }