feat: adds FastEndpoints core infrastructure and contracts to the web project

This commit is contained in:
BinaryAlley committed 2026-08-17 11:52:20 -07:00
1 parent 394b33efd2
commit 733e174cac
137 files changed
+3139 -158

No files matched your search

@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a lightweight book element, containing only the properties needed by the client for card-style navigation.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookLiteDto
{
/// <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,71 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Library;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a library element.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class LibraryDto
{
/// <summary>
/// Gets or sets the unique identifier of the media library.
/// </summary>
public Guid? Id { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user owning the media library.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets the title of the library.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Gets or sets the type of the library.
/// </summary>
public string? LibraryType { get; set; }
/// <summary>
/// Gets or sets the path of the image file used as the cover for the library.
/// </summary>
public string? CoverImage { get; set; }
/// <summary>
/// Gets or sets the collection of directories that contain the library files.
/// </summary>
public List<string> ContentLocations { get; set; } = [];
/// <summary>
/// Gets or sets whether this media library is enabled or not. A disabled media library is never shown or changed.
/// </summary>
public bool IsEnabled { get; set; } = true;
/// <summary>
/// Gets or sets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
/// </summary>
public bool IsLocked { get; set; } = false;
/// <summary>
/// Gets or sets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMetadataFromWeb { get; set; } = true;
/// <summary>
/// Gets or sets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool ShouldSaveMetadataInMediaDirectories { get; set; } = false;
/// <summary>
/// Gets or sets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan. This is an opt-in setting, because it relies on directory metadata,
/// which does not change when the contents of an existing file are edited, and such edits could be missed while this setting is enabled.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; set; } = false;
}
@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan job progress model.
/// </summary>
[DebuggerDisplay("CompletedItems: {CompletedItems}; TotalItems: {TotalItems}")]
public class LibraryScanJobProgressDto
{
/// <summary>
/// Gets or sets the number of completed items of the media library scan job.
/// </summary>
public int CompletedItems { get; set; }
/// <summary>
/// Gets or sets the total number of items of the media library scan job.
/// </summary>
public int TotalItems { get; set; }
/// <summary>
/// Gets or sets the current operation being performed by the media library scan job.
/// </summary>
public string? CurrentOperation { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of items, as a percentage.
/// </summary>
public decimal ProgressPercentage { get; set; }
}
@@ -0,0 +1,53 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan progress model.
/// </summary>
[DebuggerDisplay("ScanId: {ScanId}; UserId: {UserId}; LibraryId: {LibraryId}")]
public class LibraryScanProgressDto
{
/// <summary>
/// Gets or sets the unique identifier of the media library scan.
/// </summary>
public Guid ScanId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user initiating this media library scan.
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the media library that is scanned.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the number of completed jobs of the media library scan job.
/// </summary>
public int CompletedJobs { get; set; }
/// <summary>
/// Gets or sets the total number of jobs of the media library scan job.
/// </summary>
public int TotalJobs { get; set; }
/// <summary>
/// Gets or sets the optional current job progress of the media library scan.
/// </summary>
public LibraryScanJobProgressDto? CurrentJobProgress { get; set; }
/// <summary>
/// Gets or sets the status of the media library scan.
/// </summary>
public string? Status { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of jobs, as a percentage.
/// </summary>
public decimal OverallProgressPercentage { get; set; }
}
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a paginated collection of lightweight book elements, together with pagination metadata.
/// </summary>
[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")]
public class PaginatedBookLiteDto
{
/// <summary>
/// Gets or sets the collection of lightweight book elements associated with this instance.
/// </summary>
public IReadOnlyList<BookLiteDto> 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; }
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan response.
/// </summary>
[DebuggerDisplay("ScanId: {ScanId} LibraryId: {LibraryId}")]
public class ScanLibraryDto
{
/// <summary>
/// Gets or sets the Id of the media library scan.
/// </summary>
public Guid? ScanId { get; set; }
/// <summary>
/// Gets or sets the Id of the scanned media library.
/// </summary>
public Guid? LibraryId { get; set; }
}