Adds first draft of books media library view.

This commit is contained in:
BinaryAlley committed 2026-08-16 23:42:56 -07:00
1 parent 6fa154a2e7
commit a4b1d0ff66
20 files changed
+1109 -17

No files matched your search

@@ -0,0 +1,17 @@
namespace Lumina.Presentation.Web.Common.Enums.Common;
/// <summary>
/// Enumeration for the sort order.
/// </summary>
public enum SortOrder
{
/// <summary>
/// Ascending order.
/// </summary>
Ascending,
/// <summary>
/// Descending order.
/// </summary>
Descending
}
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Libraries;
/// <summary>
/// Represents the query parameters used to retrieve the lightweight details of the books of a media library.
/// </summary>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public class BookLibraryItemsQueryModel
{
/// <summary>
/// Gets or sets the Id of the media library whose books are retrieved.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the page of results to retrieve.
/// </summary>
public int? CurrentPage { get; set; }
/// <summary>
/// Gets or sets the maximum number of books to retrieve per page.
/// </summary>
public int? PerPage { get; set; }
/// <summary>
/// Gets or sets the search term used to filter results.
/// </summary>
public string? SearchTerm { get; set; }
/// <summary>
/// Gets or sets the alpha key used to filter the results by the first character of their title, for the alpha picker.
/// Can be <see langword="null"/> to disable alpha filtering, a single ASCII letter (case-insensitive) to filter by that letter,
/// "#" to filter by titles whose first character is a digit, or "*" to filter by titles whose first character is neither a letter nor a digit.
/// </summary>
public string? FilterAlphaKey { get; set; }
/// <summary>
/// Gets or sets whether the leading "The " prefix of a title is ignored when computing the alpha key, or not.
/// </summary>
public bool IgnoreThePrefixForAlphaPicker { get; set; }
/// <summary>
/// Gets or sets the name of the field by which to sort the results.
/// </summary>
public string? SortBy { get; set; }
/// <summary>
/// Gets or sets the direction in which to sort the results.
/// </summary>
public SortOrder? SortOrder { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Libraries;
/// <summary>
/// Represents a lightweight book element, containing only the properties needed by the client for card-style navigation.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookLiteModel
{
/// <summary>
/// Gets or sets the Id of the book.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the title of the book.
/// </summary>
public string Title { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the release year of the book (re-release year, if available, or original release year), if known.
/// </summary>
public int? ReleaseYear { get; set; }
/// <summary>
/// Gets or sets the path of the image representing the cover of the book, if available.
/// </summary>
public string? CoverPath { get; set; }
}
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Libraries;
/// <summary>
/// Represents a paginated collection of lightweight book elements, together with pagination metadata.
/// </summary>
[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")]
public class PaginatedBookLiteModel
{
/// <summary>
/// Gets or sets the collection of lightweight book elements associated with this instance.
/// </summary>
public IReadOnlyList<BookLiteModel> Data { get; set; } = [];
/// <summary>
/// Gets or sets the current page number in a paginated collection.
/// </summary>
public int CurrentPage { get; set; }
/// <summary>
/// Gets or sets the number of items to include per page in paginated results.
/// </summary>
public int PerPage { get; set; }
/// <summary>
/// Gets or sets the total number of elements available in the paginated result set.
/// </summary>
public int Count { get; set; }
/// <summary>
/// Gets or sets the total number of pages based on elements available in the result set and per page.
/// </summary>
public int NumberOfPages { get; set; }
}