#region ========================================================================= USING ===================================================================================== using Lumina.Domain.SharedKernel.Common.Enums.Plugins; using Lumina.Plugins.Contracts.Common.Models.DTO.Settings; using Lumina.Plugins.Contracts.Core.Plugins; using Lumina.Plugins.CoverArtArchive.Common.DependencyInjection; using Lumina.Plugins.CoverArtArchive.Core.Settings; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; #endregion namespace Lumina.Plugins.CoverArtArchive.Core; /// /// Plugin that provides music album artwork retrieval from the Cover Art Archive. /// public sealed class CoverArtArchivePlugin : IPlugin, IPluginServiceRegistrator { /// /// The unique identifier of the plugin. /// public static readonly Guid s_pluginId = new("b7e4c2a9-1f38-4d65-9a02-3e6b8f5c7d14"); /// /// Gets the unique identifier of the plugin. /// public Guid Id => s_pluginId; /// /// Gets the display name of the plugin. /// public string Name => "Cover Art Archive"; /// /// Gets the author of the plugin. /// public string Author => "Lumina"; /// /// Gets the version of the plugin. /// public Version Version => new(1, 0, 0); /// /// Gets the description of the plugin. /// public string Description => "Retrieves the cover, back, booklet, medium and other artwork of music albums from the Cover Art Archive."; /// /// Gets the settings schema of the plugin. /// /// The settings descriptors of the plugin. public IReadOnlyList GetSettingsSchema() { return [ new PluginSettingDescriptorDto( Key: CoverArtArchiveSettingsKeys.CONTACT_EMAIL, Label: "Contact Email", Type: PluginSettingType.Text), new PluginSettingDescriptorDto( Key: CoverArtArchiveSettingsKeys.MINIMUM_REQUEST_INTERVAL_SECONDS, Label: "Minimum Request Interval (seconds)", Type: PluginSettingType.Number, DefaultValue: "1.0") ]; } /// /// Registers the services required by the plugin. /// /// The service collection to register the services into. public void RegisterServices(IServiceCollection services) { services.AddCoverArtArchiveArtworkProvider(pluginId: Id); } }