Adds the should aggregate artwork when missing setting to the user settings, configuration, and validation

This commit is contained in:
BinaryAlley committed 2026-10-10 13:05:00 +03:00
1 parent 6b5e731546
commit e139a7bb00
21 files changed
+97 -43

No files matched your search

@@ -22,17 +22,20 @@ public class MediaSettingsDtoFixture
/// <param name="rootDirectory">Optional. The root directory where media files are stored.</param>
/// <param name="librariesDirectory">Optional. The directory where media library files are stored.</param>
/// <param name="booksDirectory">Optional. The directory where the media item files are stored.</param>
/// <param name="musicDirectory">Optional. The directory where the music library item files are stored.</param>
/// <returns>The created <see cref="MediaSettingsDto"/>.</returns>
public MediaSettingsDto Create(
string? rootDirectory = null,
string? librariesDirectory = null,
string? booksDirectory = null)
string? booksDirectory = null,
string? musicDirectory = null)
{
return new MediaSettingsDto
{
RootDirectory = rootDirectory ?? _faker.System.DirectoryPath(),
LibrariesDirectory = librariesDirectory ?? _faker.System.DirectoryPath(),
BooksDirectory = booksDirectory ?? _faker.System.DirectoryPath()
BooksDirectory = booksDirectory ?? _faker.System.DirectoryPath(),
MusicDirectory = musicDirectory ?? _faker.System.DirectoryPath()
};
}
@@ -22,6 +22,7 @@ public class UpdateUserSettingsCommandFixture
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Optional. Whether the "The" prefix is ignored by the alpha picker, or not.</param>
/// <param name="isThemeCachingEnabled">Optional. Whether the theme data served to this user is cached, or not.</param>
/// <param name="shouldAggregateMetadataWhenMissing">Optional. Whether the metadata of the media library items is aggregated from multiple providers, when fields are missing.</param>
/// <param name="shouldAggregateArtworkWhenMissing">Optional. Whether the artwork of the media library items is aggregated from multiple providers, when it is missing.</param>
/// <param name="shouldRenderPdfAsImages">Optional. Whether PDF books are rendered as page images for the user.</param>
/// <param name="shouldPreserveBookStyles">Optional. Whether the styles of the book content are preserved when it is rendered for the user.</param>
/// <returns>The created command.</returns>
@@ -31,16 +32,18 @@ public class UpdateUserSettingsCommandFixture
bool? shouldIgnoreThePrefixForAlphaPicker = null,
bool? isThemeCachingEnabled = null,
bool? shouldAggregateMetadataWhenMissing = null,
bool? shouldAggregateArtworkWhenMissing = null,
bool? shouldRenderPdfAsImages = null,
bool? shouldPreserveBookStyles = null)
{
return new Faker<UpdateUserSettingsCommand>()
.CustomInstantiator(f => new UpdateUserSettingsCommand(default, default, default, default, default, default, default))
.CustomInstantiator(f => new UpdateUserSettingsCommand(default, default, default, default, default, default, default, default))
.RuleFor(x => x.IsPaginationEnabled, f => isPaginationEnabled ?? f.Random.Bool())
.RuleFor(x => x.ItemsPerPage, f => itemsPerPage ?? f.Random.Int(1, 100))
.RuleFor(x => x.ShouldIgnoreThePrefixForAlphaPicker, f => shouldIgnoreThePrefixForAlphaPicker ?? f.Random.Bool())
.RuleFor(x => x.IsThemeCachingEnabled, f => isThemeCachingEnabled ?? f.Random.Bool())
.RuleFor(x => x.ShouldAggregateMetadataWhenMissing, f => shouldAggregateMetadataWhenMissing ?? f.Random.Bool())
.RuleFor(x => x.ShouldAggregateArtworkWhenMissing, f => shouldAggregateArtworkWhenMissing ?? f.Random.Bool())
.RuleFor(x => x.ShouldRenderPdfAsImages, f => shouldRenderPdfAsImages ?? f.Random.Bool())
.RuleFor(x => x.ShouldPreserveBookStyles, f => shouldPreserveBookStyles ?? f.Random.Bool())
.Generate();
@@ -24,6 +24,7 @@ public class UpdateUserSettingsRequestFixture
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Whether the "The" prefix is ignored by the alpha picker.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached.</param>
/// <param name="shouldAggregateMetadataWhenMissing">Whether the metadata of the media library items is aggregated from multiple providers, when fields are missing.</param>
/// <param name="shouldAggregateArtworkWhenMissing">Whether the artwork of the media library items is aggregated from multiple providers, when it is missing.</param>
/// <param name="shouldRenderPdfAsImages">Whether PDF books are rendered as page images for the user.</param>
/// <param name="shouldPreserveBookStyles">Whether the styles of the book content are preserved when it is rendered for the user.</param>
/// <returns>The created <see cref="UpdateUserSettingsRequest"/>.</returns>
@@ -33,6 +34,7 @@ public class UpdateUserSettingsRequestFixture
bool? shouldIgnoreThePrefixForAlphaPicker = null,
bool? isThemeCachingEnabled = null,
bool? shouldAggregateMetadataWhenMissing = null,
bool? shouldAggregateArtworkWhenMissing = null,
bool? shouldRenderPdfAsImages = null,
bool? shouldPreserveBookStyles = null)
{
@@ -42,6 +44,7 @@ public class UpdateUserSettingsRequestFixture
shouldIgnoreThePrefixForAlphaPicker ?? _faker.Random.Bool(),
isThemeCachingEnabled ?? _faker.Random.Bool(),
shouldAggregateMetadataWhenMissing ?? _faker.Random.Bool(),
shouldAggregateArtworkWhenMissing ?? _faker.Random.Bool(),
shouldRenderPdfAsImages ?? _faker.Random.Bool(),
shouldPreserveBookStyles ?? _faker.Random.Bool());
}
@@ -26,6 +26,7 @@ public class UserSettingsResponseFixture
/// <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>
/// <param name="shouldAggregateArtworkWhenMissing">Optional. Whether the artwork of the media library items is aggregated from multiple providers, when it is missing.</param>
/// <param name="shouldRenderPdfAsImages">Optional. Whether PDF books are rendered as page images for the user.</param>
/// <param name="shouldPreserveBookStyles">Optional. Whether the styles of the book content are preserved when it is rendered for the user.</param>
/// <returns>The created <see cref="UserSettingsResponse"/>.</returns>
@@ -36,6 +37,7 @@ public class UserSettingsResponseFixture
bool? shouldIgnoreThePrefixForAlphaPicker = null,
bool? isThemeCachingEnabled = null,
bool? shouldAggregateMetadataWhenMissing = null,
bool? shouldAggregateArtworkWhenMissing = null,
bool? shouldRenderPdfAsImages = null,
bool? shouldPreserveBookStyles = null)
{
@@ -46,6 +48,7 @@ public class UserSettingsResponseFixture
shouldIgnoreThePrefixForAlphaPicker ?? _faker.Random.Bool(),
isThemeCachingEnabled ?? _faker.Random.Bool(),
shouldAggregateMetadataWhenMissing ?? _faker.Random.Bool(),
shouldAggregateArtworkWhenMissing ?? _faker.Random.Bool(),
shouldRenderPdfAsImages ?? _faker.Random.Bool(),
shouldPreserveBookStyles ?? _faker.Random.Bool());
}
@@ -25,6 +25,7 @@ public class UserSettingsFixture
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached.</param>
/// <param name="shouldAggregateMetadataWhenMissing">Whether the metadata of the media library items is aggregated from multiple providers, when fields are missing.</param>
/// <param name="shouldAggregateArtworkWhenMissing">Whether the artwork of the media library items is aggregated from multiple providers, when it is missing.</param>
/// <param name="shouldRenderPdfAsImages">Whether PDF books are rendered as page images for the user.</param>
/// <param name="shouldPreserveBookStyles">Whether the styles of the book content are preserved when it is rendered for the user.</param>
/// <returns>The created <see cref="UserSettings"/>.</returns>
@@ -35,6 +36,7 @@ public class UserSettingsFixture
bool shouldIgnoreThePrefixForAlphaPicker = false,
bool isThemeCachingEnabled = true,
bool shouldAggregateMetadataWhenMissing = false,
bool shouldAggregateArtworkWhenMissing = false,
bool shouldRenderPdfAsImages = false,
bool shouldPreserveBookStyles = true)
{
@@ -45,6 +47,7 @@ public class UserSettingsFixture
shouldIgnoreThePrefixForAlphaPicker,
isThemeCachingEnabled,
shouldAggregateMetadataWhenMissing,
shouldAggregateArtworkWhenMissing,
shouldRenderPdfAsImages,
shouldPreserveBookStyles);
return settings.Value;