Adds provider configuration to media library saves

Moves metadata provider, artwork provider, and book reader choices into the add and update library requests, adds the library type lookups, removes the per-provider enable and reorder endpoints, and reconciles the stored configurations in one provider store call. Tightens library update and delete authorization to require ownership and the manage permission, and cleans up enum validation, comments, resource diacritics, and Razor imports.
This commit is contained in:
BinaryAlley committed 2026-11-02 10:00:00 +02:00
1 parent 2e7563199a
commit 48ad8692af
148 files changed
+6305 -2936

No files matched your search

@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for the data of the media libraries management page.
/// </summary>
/// <param name="CanManageLibraries">Whether the current user can change and delete their media libraries, which takes the permission to manage media libraries, or the administrator role.</param>
[DebuggerDisplay("CanManageLibraries: {CanManageLibraries}")]
public sealed record LibrariesIndexPageDto(
bool CanManageLibraries
);
@@ -17,11 +17,6 @@ public class LibraryDto
/// </summary>
public Guid? Id { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user owning the media library.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets the title of the library.
/// </summary>
@@ -88,4 +83,22 @@ public class LibraryDto
/// Gets or sets the ordered parts of the template describing the structure of the media library on disk.
/// </summary>
public List<LibraryPathTemplatePartDto> PathTemplateParts { get; set; } = [];
/// <summary>
/// Gets or sets the metadata providers of the media library, in the order in which they are tried, and whether each one is enabled. When absent, the providers are configured
/// with their defaults on create, and on update the stored configurations are kept, or reconciled with the library type when it changes.
/// </summary>
public List<LibraryProviderSelectionDto>? MetadataProviders { get; set; }
/// <summary>
/// Gets or sets the artwork providers of the media library, in the order in which they are tried, and whether each one is enabled. When absent, the providers are configured
/// with their defaults on create, and on update the stored configurations are kept, or reconciled with the library type when it changes.
/// </summary>
public List<LibraryProviderSelectionDto>? ArtworkProviders { get; set; }
/// <summary>
/// Gets or sets the book readers of the media library, and whether each one is enabled. When absent, the readers are configured with their defaults on create, and on update
/// the stored configurations are kept, or reconciled with the library type when it changes.
/// </summary>
public List<LibraryProviderSelectionDto>? BookReaders { get; set; }
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for the choice made for one metadata provider, artwork provider or book reader of a media library.
/// </summary>
[DebuggerDisplay("PluginId: {PluginId}; IsEnabled: {IsEnabled}")]
public class LibraryProviderSelectionDto
{
/// <summary>
/// Gets or sets the unique identifier of the plugin providing the metadata provider, artwork provider or book reader.
/// </summary>
public Guid PluginId { get; set; }
/// <summary>
/// Gets or sets whether the provider or reader is enabled for the media library. Optional, the stored state is kept when absent, and a provider or reader without a stored state starts disabled.
/// </summary>
public bool? IsEnabled { get; set; }
}