Adds metadata aggregation to the media library enrichment job

This commit is contained in:
BinaryAlley committed 2026-08-24 14:18:40 -07:00
1 parent c82fadc7a2
commit 66871ccf62
168 files changed
+3503 -1062

No files matched your search

@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.UsersManagement.Settings;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.UsersManagement.Settings;
/// <summary>
/// Fixture class for the <see cref="UserSettingsResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class UserSettingsResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="UserSettingsResponse"/>.
/// </summary>
/// <param name="userId">Optional. The Id of the user that owns these settings.</param>
/// <param name="isPaginationEnabled">Optional. Whether pagination is enabled for the user.</param>
/// <param name="itemsPerPage">Optional. The number of library items displayed per page when pagination is enabled.</param>
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Optional. Whether the "The" prefix is ignored by the alpha picker.</param>
/// <param name="isThemeCachingEnabled">Optional. Whether the theme data served to this user is cached.</param>
/// <param name="shouldAggregateMetadataWhenMissing">Optional. Whether the metadata of the media library items is aggregated from multiple providers, when fields are missing.</param>
/// <returns>The created <see cref="UserSettingsResponse"/>.</returns>
public UserSettingsResponse Create(
Guid? userId = null,
bool? isPaginationEnabled = null,
int? itemsPerPage = null,
bool? shouldIgnoreThePrefixForAlphaPicker = null,
bool? isThemeCachingEnabled = null,
bool? shouldAggregateMetadataWhenMissing = null)
{
return new UserSettingsResponse(
userId ?? Guid.NewGuid(),
isPaginationEnabled ?? _faker.Random.Bool(),
itemsPerPage ?? _faker.Random.Int(1, 100),
shouldIgnoreThePrefixForAlphaPicker ?? _faker.Random.Bool(),
isThemeCachingEnabled ?? _faker.Random.Bool(),
shouldAggregateMetadataWhenMissing ?? _faker.Random.Bool());
}
/// <summary>
/// Creates a list of <see cref="UserSettingsResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<UserSettingsResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}