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:
BinaryAlley committed 2026-08-26 21:49:49 +03:00
1 parent 4b861d8323
commit 4ee2976806
30 files changed
+905 -1

No files matched your search

@@ -0,0 +1,46 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Presentation.Web.Common.Requests.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
/// <summary>
/// Fixture class for generating <see cref="ReorderLibraryArtworkProvidersRequest"/> test data.
/// </summary>
[ExcludeFromCodeCoverage]
public class ReorderLibraryArtworkProvidersRequestFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a new <see cref="ReorderLibraryArtworkProvidersRequest"/> instance with randomized test data.
/// </summary>
/// <param name="libraryId">Optional identifier of the media library.</param>
/// <param name="pluginIds">Optional plugin Ids in the new order.</param>
/// <returns>A configured <see cref="ReorderLibraryArtworkProvidersRequest"/> instance.</returns>
public ReorderLibraryArtworkProvidersRequest Create(
Guid? libraryId = null,
List<Guid>? pluginIds = null)
{
return new ReorderLibraryArtworkProvidersRequest
{
LibraryId = libraryId ?? Guid.NewGuid(),
PluginIds = pluginIds ?? [_faker.Random.Guid(), _faker.Random.Guid()]
};
}
/// <summary>
/// Creates multiple <see cref="ReorderLibraryArtworkProvidersRequest"/> instances with randomized test data.
/// </summary>
/// <param name="count">Number of instances to create.</param>
/// <returns>List of configured <see cref="ReorderLibraryArtworkProvidersRequest"/> instances.</returns>
public List<ReorderLibraryArtworkProvidersRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,49 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Presentation.Web.Common.Requests.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
/// <summary>
/// Fixture class for generating <see cref="SetLibraryArtworkProviderEnabledRequest"/> test data.
/// </summary>
[ExcludeFromCodeCoverage]
public class SetLibraryArtworkProviderEnabledRequestFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a new <see cref="SetLibraryArtworkProviderEnabledRequest"/> instance with randomized test data.
/// </summary>
/// <param name="libraryId">Optional identifier of the media library.</param>
/// <param name="pluginId">Optional identifier of the plugin.</param>
/// <param name="isEnabled">Optional value indicating whether the artwork provider is enabled.</param>
/// <returns>A configured <see cref="SetLibraryArtworkProviderEnabledRequest"/> instance.</returns>
public SetLibraryArtworkProviderEnabledRequest Create(
Guid? libraryId = null,
Guid? pluginId = null,
bool? isEnabled = null)
{
return new SetLibraryArtworkProviderEnabledRequest
{
LibraryId = libraryId ?? Guid.NewGuid(),
PluginId = pluginId ?? Guid.NewGuid(),
IsEnabled = isEnabled ?? _faker.Random.Bool()
};
}
/// <summary>
/// Creates multiple <see cref="SetLibraryArtworkProviderEnabledRequest"/> instances with randomized test data.
/// </summary>
/// <param name="count">Number of instances to create.</param>
/// <returns>List of configured <see cref="SetLibraryArtworkProviderEnabledRequest"/> instances.</returns>
public List<SetLibraryArtworkProviderEnabledRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}