mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Adds artwork provider management to the library edit page
Adds the artwork providers list to the library edit page, mirroring the metadata providers list, so that the artwork providers of a library can be enabled, disabled and reordered. Adds the web routes, request types, DTO and endpoints that proxy the artwork provider operations to the API.
This commit is contained in:
1 parent
4b861d8323
commit
4ee2976806
30 files changed
+905
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Data transfer object for an artwork provider configured for a media library.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public class LibraryArtworkProviderDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin providing the artwork.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display name of the artwork provider.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the artwork provider is enabled for the media library.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rank of the artwork provider, determining the order in which providers are tried.
|
||||
/// </summary>
|
||||
public int Rank { get; set; }
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request for retrieving the artwork providers of a media library.
|
||||
/// </summary>
|
||||
/// <param name="LibraryId">The unique identifier of the media library whose artwork providers are retrieved.</param>
|
||||
[DebuggerDisplay("LibraryId: {LibraryId}")]
|
||||
public record GetArtworkProvidersRequest(
|
||||
Guid LibraryId
|
||||
);
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to reorder the artwork providers of a media library.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("LibraryId: {LibraryId}")]
|
||||
public class ReorderLibraryArtworkProvidersRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Id of the media library whose artwork providers are reordered.
|
||||
/// </summary>
|
||||
public Guid LibraryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plugin Ids in the new order, from highest to lowest rank.
|
||||
/// </summary>
|
||||
public List<Guid> PluginIds { get; set; } = [];
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to enable or disable an artwork provider for a media library.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("LibraryId: {LibraryId}, PluginId: {PluginId}")]
|
||||
public class SetLibraryArtworkProviderEnabledRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Id of the media library whose artwork provider is enabled or disabled.
|
||||
/// </summary>
|
||||
public Guid LibraryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin providing the artwork.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the artwork provider should be enabled for the media library.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
@@ -24,5 +24,8 @@ public static partial class ApiRoutes
|
||||
public const string GET_LIBRARY_METADATA_PROVIDERS = "libraries/{libraryId}/metadata-providers";
|
||||
public const string SET_LIBRARY_METADATA_PROVIDER_ENABLED = "libraries/{libraryId}/metadata-providers/{pluginId}/enabled";
|
||||
public const string REORDER_LIBRARY_METADATA_PROVIDERS = "libraries/{libraryId}/metadata-providers/reorder";
|
||||
public const string GET_LIBRARY_ARTWORK_PROVIDERS = "libraries/{libraryId}/artwork-providers";
|
||||
public const string SET_LIBRARY_ARTWORK_PROVIDER_ENABLED = "libraries/{libraryId}/artwork-providers/{pluginId}/enabled";
|
||||
public const string REORDER_LIBRARY_ARTWORK_PROVIDERS = "libraries/{libraryId}/artwork-providers/reorder";
|
||||
}
|
||||
}
|
||||
@@ -25,5 +25,8 @@ public static partial class WebRoutes
|
||||
public const string GET_METADATA_PROVIDERS = "{culture}/libraries/manage/api-get-metadata-providers/{libraryId}";
|
||||
public const string SET_METADATA_PROVIDER_ENABLED = "{culture}/libraries/manage/api-set-metadata-provider-enabled";
|
||||
public const string REORDER_METADATA_PROVIDERS = "{culture}/libraries/manage/api-reorder-metadata-providers";
|
||||
public const string GET_ARTWORK_PROVIDERS = "{culture}/libraries/manage/api-get-artwork-providers/{libraryId}";
|
||||
public const string SET_ARTWORK_PROVIDER_ENABLED = "{culture}/libraries/manage/api-set-artwork-provider-enabled";
|
||||
public const string REORDER_ARTWORK_PROVIDERS = "{culture}/libraries/manage/api-reorder-artwork-providers";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user