Merge branch 'feature/add-artwork-provider-system' into feature/add-artwork-provider-and-metadata-aggregation

This commit is contained in:
BinaryAlley committed 2026-08-24 22:53:55 -07:00
commit 0f872b5666
124 files changed
+9715 -74

No files matched your search

@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.Common;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.DTO.Common;
/// <summary>
/// Fixture class for the <see cref="ArtworkDto"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class ArtworkDtoFixture
{
/// <summary>
/// Creates an <see cref="ArtworkDto"/>.
/// </summary>
/// <param name="localPath">Optional. The local file system path of the artwork.</param>
/// <param name="remoteUrl">Optional. The remote URL of the artwork.</param>
/// <returns>The created <see cref="ArtworkDto"/>.</returns>
public ArtworkDto Create(
string? localPath = null,
string? remoteUrl = null)
{
return new ArtworkDto(localPath, remoteUrl);
}
/// <summary>
/// Creates a list of <see cref="ArtworkDto"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<ArtworkDto> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,42 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Requests.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Requests.Plugins;
/// <summary>
/// Fixture class for the <see cref="GetLibraryArtworkProvidersRequest"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetLibraryArtworkProvidersRequestFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="GetLibraryArtworkProvidersRequest"/>.
/// </summary>
/// <param name="libraryId">Optional. The Id of the media library whose artwork providers are retrieved.</param>
/// <returns>The created <see cref="GetLibraryArtworkProvidersRequest"/>.</returns>
public GetLibraryArtworkProvidersRequest Create(
Guid? libraryId = null)
{
return new GetLibraryArtworkProvidersRequest(
libraryId ?? _faker.Random.Guid()
);
}
/// <summary>
/// Creates a list of <see cref="GetLibraryArtworkProvidersRequest"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<GetLibraryArtworkProvidersRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,45 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Requests.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Requests.Plugins;
/// <summary>
/// Fixture class for the <see cref="ReorderLibraryArtworkProvidersRequest"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class ReorderLibraryArtworkProvidersRequestFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="ReorderLibraryArtworkProvidersRequest"/>.
/// </summary>
/// <param name="libraryId">Optional. The Id of the media library whose artwork providers are reordered.</param>
/// <param name="pluginIds">Optional. The plugin Ids in the new order.</param>
/// <returns>The created <see cref="ReorderLibraryArtworkProvidersRequest"/>.</returns>
public ReorderLibraryArtworkProvidersRequest Create(
Guid? libraryId = null,
IReadOnlyList<Guid>? pluginIds = null)
{
return new ReorderLibraryArtworkProvidersRequest(
libraryId ?? _faker.Random.Guid(),
pluginIds ?? [Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()]
);
}
/// <summary>
/// Creates a list of <see cref="ReorderLibraryArtworkProvidersRequest"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<ReorderLibraryArtworkProvidersRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,48 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Requests.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Requests.Plugins;
/// <summary>
/// Fixture class for the <see cref="SetLibraryArtworkProviderEnabledRequest"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class SetLibraryArtworkProviderEnabledRequestFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="SetLibraryArtworkProviderEnabledRequest"/>.
/// </summary>
/// <param name="libraryId">Optional. The Id of the media library whose artwork provider is enabled or disabled.</param>
/// <param name="pluginId">Optional. The Id of the plugin providing the artwork.</param>
/// <param name="isEnabled">Optional. Whether the artwork provider should be enabled.</param>
/// <returns>The created <see cref="SetLibraryArtworkProviderEnabledRequest"/>.</returns>
public SetLibraryArtworkProviderEnabledRequest Create(
Guid? libraryId = null,
Guid? pluginId = null,
bool? isEnabled = null)
{
return new SetLibraryArtworkProviderEnabledRequest(
libraryId ?? _faker.Random.Guid(),
pluginId ?? _faker.Random.Guid(),
isEnabled ?? _faker.Random.Bool()
);
}
/// <summary>
/// Creates a list of <see cref="SetLibraryArtworkProviderEnabledRequest"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<SetLibraryArtworkProviderEnabledRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,50 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.Plugins;
/// <summary>
/// Fixture class for the <see cref="LibraryArtworkProviderResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class LibraryArtworkProviderResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="LibraryArtworkProviderResponse"/>.
/// </summary>
/// <param name="pluginId">Optional. The Id of the plugin providing the artwork.</param>
/// <param name="name">Optional. The display name of the artwork provider.</param>
/// <param name="isEnabled">Optional. Whether the artwork provider is enabled for the media library.</param>
/// <param name="rank">Optional. The rank of the artwork provider.</param>
/// <returns>The created <see cref="LibraryArtworkProviderResponse"/>.</returns>
public LibraryArtworkProviderResponse Create(
Guid? pluginId = null,
string? name = null,
bool? isEnabled = null,
int? rank = null)
{
return new LibraryArtworkProviderResponse(
pluginId ?? Guid.NewGuid(),
name ?? _faker.Company.CompanyName(),
isEnabled ?? _faker.Random.Bool(),
rank ?? _faker.Random.Int(1, 100));
}
/// <summary>
/// Creates a list of <see cref="LibraryArtworkProviderResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<LibraryArtworkProviderResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}