mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 22:01:10 +00:00
66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
#region ========================================================================= USING =====================================================================================
|
|
using Lumina.Plugins.Contracts.Common.Models.DTO.Settings;
|
|
using Lumina.Plugins.Contracts.Core.Plugins;
|
|
using Lumina.Plugins.Calibre.Common.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
#endregion
|
|
|
|
namespace Lumina.Plugins.Calibre.Core;
|
|
|
|
/// <summary>
|
|
/// Plugin that provides book metadata and book covers from Calibre OPF files.
|
|
/// </summary>
|
|
public sealed class CalibrePlugin : IPlugin, IPluginServiceRegistrator
|
|
{
|
|
/// <summary>
|
|
/// The unique identifier of the plugin.
|
|
/// </summary>
|
|
public static readonly Guid s_pluginId = new("a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d");
|
|
|
|
/// <summary>
|
|
/// Gets the unique identifier of the plugin.
|
|
/// </summary>
|
|
public Guid Id => s_pluginId;
|
|
|
|
/// <summary>
|
|
/// Gets the display name of the plugin.
|
|
/// </summary>
|
|
public string Name => "Calibre Metadata";
|
|
|
|
/// <summary>
|
|
/// Gets the author of the plugin.
|
|
/// </summary>
|
|
public string Author => "Lumina";
|
|
|
|
/// <summary>
|
|
/// Gets the version of the plugin.
|
|
/// </summary>
|
|
public Version Version => new(1, 0, 0);
|
|
|
|
/// <summary>
|
|
/// Gets the description of the plugin.
|
|
/// </summary>
|
|
public string Description => "Reads book metadata and covers from the OPF files of a Calibre library.";
|
|
|
|
/// <summary>
|
|
/// Gets the settings schema of the plugin.
|
|
/// </summary>
|
|
/// <returns>The settings descriptors of the plugin.</returns>
|
|
public IReadOnlyList<PluginSettingDescriptorDto> GetSettingsSchema()
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Registers the services required by the plugin.
|
|
/// </summary>
|
|
/// <param name="services">The service collection to register the services into.</param>
|
|
public void RegisterServices(IServiceCollection services)
|
|
{
|
|
services.AddCalibreBookMetadataProvider(pluginId: Id);
|
|
services.AddCalibreArtworkProvider(pluginId: Id);
|
|
}
|
|
}
|