#region ========================================================================= USING ===================================================================================== using Nemera.Domain.SharedKernel.Common.Enums.Plugins; using Nemera.Plugins.Contracts.Common.Models.DTO.Settings; using Nemera.Plugins.Contracts.Core.Plugins; using Nemera.Plugins.LocalMusicArtwork.Common.DependencyInjection; using Nemera.Plugins.LocalMusicArtwork.Core.Settings; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; #endregion namespace Nemera.Plugins.LocalMusicArtwork.Core; /// /// Plugin that provides the artwork of music artists and albums from the images stored in the folders of a local music library. /// public sealed class LocalMusicArtworkPlugin : IPlugin, IPluginServiceRegistrator { /// /// The unique identifier of the plugin. /// public static readonly Guid s_pluginId = new("c9f1a7d3-2b64-4e18-8f05-7a3d9c1b6e42"); /// /// Gets the unique identifier of the plugin. /// public Guid Id => s_pluginId; /// /// Gets the display name of the plugin. /// public string Name => "Local Music Artwork"; /// /// Gets the author of the plugin. /// public string Author => "Nemera"; /// /// Gets the version of the plugin. /// public Version Version => new(1, 0, 0); /// /// Gets the description of the plugin. /// public string Description => "Reads the artwork of the artists and the albums from the images stored in the folders of a local music library."; /// /// Gets the settings schema of the plugin. /// /// The settings descriptors of the plugin. public IReadOnlyList GetSettingsSchema() { return [ new PluginSettingDescriptorDto( Key: LocalMusicArtworkSettingsKeys.SHOULD_EXTRACT_EMBEDDED_COVER, Label: "Extract embedded album cover image from audio files when it is not already present on disk", Type: PluginSettingType.Boolean, DefaultValue: "true") ]; } /// /// Registers the services required by the plugin. /// /// The service collection to register the services into. public void RegisterServices(IServiceCollection services) { services.AddLocalMusicArtworkProviders(pluginId: Id); } }