mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
refactor: removes legacy MVC infrastructure from the web project
This commit is contained in:
1 parent
077eb2bdb4
commit
394b33efd2
300 files changed
-41701
No files matched your search
@@ -1,25 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Filters.TypeFilters;
|
||||
using Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Attribute that restricts endpoint access to users with specified permissions.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be applied to controllers or individual actions. Multiple permissions create an OR condition.
|
||||
/// </remarks>
|
||||
public class RequirePermissionAttribute : ApiAuthorizationAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequirePermissionAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="permissions">One or more permissions that are allowed to access the endpoint.</param>
|
||||
public RequirePermissionAttribute(params AuthorizationPermission[] permissions) : base()
|
||||
{
|
||||
Arguments = [new AuthorizationRequirementModel { Permissions = permissions }];
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Filters.TypeFilters;
|
||||
using Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Attribute that restricts endpoint access based on a custom authorization policy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be applied to controllers or individual actions.
|
||||
/// </remarks>
|
||||
public class RequirePolicyAttribute : ApiAuthorizationAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequirePolicyAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="policyType">The type of the authorization policy to apply.</param>
|
||||
public RequirePolicyAttribute(Type policyType) : base()
|
||||
{
|
||||
Arguments = [new AuthorizationRequirementModel { PolicyType = policyType }];
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Filters.TypeFilters;
|
||||
using Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Attribute that restricts endpoint access to users with specified roles.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be applied to controllers or individual actions. Multiple roles create an OR condition.
|
||||
/// </remarks>
|
||||
public class RequireRoleAttribute : ApiAuthorizationAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequireRoleAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="roles">One or more roles that are allowed to access the endpoint.</param>
|
||||
public RequireRoleAttribute(params string[] roles) : base()
|
||||
{
|
||||
Arguments = [new AuthorizationRequirementModel { Roles = roles }];
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Filters.ActionFilters;
|
||||
|
||||
/// <summary>
|
||||
/// Attribute that enforces application initialization checks on controller actions.
|
||||
/// </summary>
|
||||
public class InitializationCheckAttribute : ActionFilterAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Asynchronously executes the initialization check before the action executes.
|
||||
/// </summary>
|
||||
/// <param name="context">The context for the action being executed.</param>
|
||||
/// <param name="next">Delegate to execute the next action filter in the pipeline.</param>
|
||||
public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
{
|
||||
IAuthorizationService authorizationService = context.HttpContext.RequestServices.GetRequiredService<IAuthorizationService>();
|
||||
await authorizationService.AuthorizeAsync(context.HttpContext.User, context.HttpContext, "RequireInitialization").ConfigureAwait(false);
|
||||
await next().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Filters.ActionFilters;
|
||||
|
||||
/// <summary>
|
||||
/// Stores the current view path in session, for actions that return ViewResult. This is needed because when JWT expires, user is redirected to Login view, with a returnUrl.
|
||||
/// This returnUrl needs to be that of the last displayed view, not of the call that triggered the re-authentication request, which can be an API call for data.
|
||||
/// </summary>
|
||||
public class StoreLastViewFilter : IActionFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes before the action method is called.
|
||||
/// </summary>
|
||||
/// <param name="context">The action executing context.</param>
|
||||
public void OnActionExecuting(ActionExecutingContext context)
|
||||
{
|
||||
// no action needed before execution
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes after the action method is called.
|
||||
/// </summary>
|
||||
/// <param name="context">The action executed context containing the action result.</param>
|
||||
public void OnActionExecuted(ActionExecutedContext context)
|
||||
{
|
||||
if (context.Result is ViewResult)
|
||||
{
|
||||
HttpContext httpContext = context.HttpContext;
|
||||
// ignore the login endpoint, because it is incorrect to be redirected to the login URL, with the login URL as the return URL
|
||||
if (httpContext.Request.Path != "/en-us/auth/login")
|
||||
httpContext.Session.SetString(HttpContextItemKeys.LAST_DISPLAYED_VIEW, $"{httpContext.Request.PathBase}{httpContext.Request.Path}{httpContext.Request.QueryString}");
|
||||
}
|
||||
}
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Exceptions;
|
||||
using Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Filters.AuthorizationFilters;
|
||||
|
||||
/// <summary>
|
||||
/// Implements authorization filter logic for API endpoints by validating user roles, permissions, and policies.
|
||||
/// </summary>
|
||||
public class ApiAuthorizationFilter : IAsyncAuthorizationFilter
|
||||
{
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
private readonly AuthorizationRequirementModel _requirement;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiAuthorizationFilter"/> class.
|
||||
/// </summary>
|
||||
/// <param name="authorizationService">Injected service for interactions with the API.</param>
|
||||
/// <param name="requirement">Authorization requirements to evaluate.</param>
|
||||
public ApiAuthorizationFilter(IAuthorizationService authorizationService, AuthorizationRequirementModel requirement)
|
||||
{
|
||||
_authorizationService = authorizationService;
|
||||
_requirement = requirement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs authorization for the current request.
|
||||
/// </summary>
|
||||
/// <param name="context">The authorization filter context.</param>
|
||||
public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!await _authorizationService.EvaluateAuthorizationAsync(_requirement))
|
||||
context.Result = new ForbidResult();
|
||||
}
|
||||
catch (ApiException ex) // TODO: check if it should really catch exceptions here
|
||||
{
|
||||
if (ex.HttpStatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
await context.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme).ConfigureAwait(false);
|
||||
context.HttpContext.Response.Cookies.Delete("Token");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Filters.AuthorizationFilters;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Filters.TypeFilters;
|
||||
|
||||
/// <summary>
|
||||
/// Authorization filter for API endpoints.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attribute can be applied to both classes and methods and supports multiple instances on the same target.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
|
||||
public class ApiAuthorizationAttribute : TypeFilterAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiAuthorizationAttribute"/> class.
|
||||
/// </summary>
|
||||
public ApiAuthorizationAttribute() : base(typeof(ApiAuthorizationFilter))
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.Extensions.Options;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.MiddlewareFilters;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a pipeline for configuring middleware to handle localization.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To use a MiddlewareFilter, you first need to create a pipeline. This acts as a mini startup configuration where you define an <see cref="IApplicationBuilder"/>
|
||||
/// to specify the middleware that should run as part of the pipeline. Multiple middleware can be configured in this way.
|
||||
/// </remarks>
|
||||
public class LocalizationPipeline
|
||||
{
|
||||
/// <summary>
|
||||
/// Configures the middleware pipeline to include the <see cref="RequestLocalizationMiddleware"/> for handling localization.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> used to configure the middleware pipeline.</param>
|
||||
/// <param name="options">The <see cref="IOptions{TOptions}"/> instance for <see cref="RequestLocalizationOptions"/>, containing localization settings to be applied.</param>
|
||||
public void Configure(IApplicationBuilder app, IOptions<RequestLocalizationOptions> options)
|
||||
{
|
||||
// runs the RequestLocalizationMiddleware with the provided options
|
||||
app.UseRequestLocalization(options.Value);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for adding an authorization role.
|
||||
/// </summary>
|
||||
/// <param name="RoleName">The name of the role.</param>
|
||||
/// <param name="Permissions">The collection or permissions of the role.</param>
|
||||
public record AddRoleRequestModel(
|
||||
string? RoleName,
|
||||
List<Guid>? Permissions
|
||||
);
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Authorization;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for storing the authorization requirements for accessing a resource.
|
||||
/// </summary>
|
||||
public class AuthorizationRequirementModel
|
||||
{
|
||||
/// <summary>
|
||||
/// The collection of roles required for accessing the resource.
|
||||
/// </summary>
|
||||
public string[]? Roles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The collection of permissions required for accessing the resource.
|
||||
/// </summary>
|
||||
public AuthorizationPermission[]? Permissions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of the policy required for accessing the resource.
|
||||
/// </summary>
|
||||
public Type? PolicyType { get; set; }
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Authorization;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response model for an account authorization request.
|
||||
/// </summary>
|
||||
/// <param name="UserId">The unique identifier of the user for whom the authorization is retrieved.</param>
|
||||
/// <param name="Role">The role associated to the user.</param>
|
||||
/// <param name="Permissions">The collection of permissions associated to the user.</param>
|
||||
[DebuggerDisplay("UserId: {UserId}")]
|
||||
public record GetAuthorizationResponse(
|
||||
Guid UserId,
|
||||
string? Role,
|
||||
AuthorizationPermission[] Permissions
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Authorization;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for an authorization permission.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the authorization permission.</param>
|
||||
/// <param name="PermissionName">The authorization permission.</param>
|
||||
public record PermissionModel(
|
||||
Guid Id,
|
||||
AuthorizationPermission PermissionName
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for an authorization role.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the authorization role.</param>
|
||||
/// <param name="RoleName">The authorization role.</param>
|
||||
public record RoleModel(
|
||||
Guid Id,
|
||||
string RoleName
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for an authorization role with its permissions.
|
||||
/// </summary>
|
||||
/// <param name="Role">The authorization role.</param>
|
||||
/// <param name="Permissions">The permissions of the authorization role.</param>
|
||||
public record RolePermissionsModel(
|
||||
RoleModel Role,
|
||||
PermissionModel[] Permissions
|
||||
);
|
||||
@@ -1,18 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for updating an existing authorization role.
|
||||
/// </summary>
|
||||
/// <param name="RoleId">The unique identifier of the role.</param>
|
||||
/// <param name="RoleName">The name of the role.</param>
|
||||
/// <param name="Permissions">The collection of Ids of the permissions of the role.</param>
|
||||
public record UpdateRoleRequestModel(
|
||||
Guid RoleId,
|
||||
string? RoleName,
|
||||
List<Guid>? Permissions
|
||||
);
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for updating the authorization role and permissions of a user.
|
||||
/// </summary>
|
||||
/// <param name="RoleId">The unique identifier of the user.</param>
|
||||
/// <param name="RoleId">The unique identifier of the role.</param>
|
||||
/// <param name="Permissions">The collection of Ids of the permissions of the user.</param>
|
||||
public record UpdateUserRoleAndPermissionsRequestModel(
|
||||
Guid UserId,
|
||||
Guid? RoleId,
|
||||
List<Guid>? Permissions
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for a user with its authorization permissions.
|
||||
/// </summary>
|
||||
/// <param name="User">The user.</param>
|
||||
/// <param name="Permissions">The authorization permissions of the user.</param>
|
||||
public record UserPermissionsModel(
|
||||
UserModel User,
|
||||
PermissionModel[] Permissions
|
||||
);
|
||||
@@ -1,23 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a cached HTTP response, including its content and status code.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("StatusCode: {StatusCode}")]
|
||||
public class CachedResponseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the content of the cached HTTP response.
|
||||
/// </summary>
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP status code of the cached response.
|
||||
/// </summary>
|
||||
public HttpStatusCode StatusCode { get; set; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Record used for empty requests and responses.
|
||||
/// </summary>
|
||||
public record struct EmptyModel();
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get genre information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Name}")]
|
||||
public class GenreModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the genre element of the media item.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get language information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{LanguageName}")]
|
||||
public class LanguageInfoModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the ISO 639-1 two-letter language code.
|
||||
/// </summary>
|
||||
public string? LanguageCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full name of the language in English.
|
||||
/// </summary>
|
||||
public string? LanguageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an optional native name of the language.
|
||||
/// </summary>
|
||||
public string? NativeName { get; set; }
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Notifications;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Model for notifications.
|
||||
/// </summary>
|
||||
/// <param name="Id">The id of the notification.</param>
|
||||
/// <param name="Message">The message of the notification.</param>
|
||||
/// <param name="Type">The type of the notification.</param>
|
||||
public record struct NotificationModel(
|
||||
Guid Id,
|
||||
string Message,
|
||||
NotificationType Type
|
||||
);
|
||||
@@ -1,52 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Model that follows the RFC 7807 standard for problem details in HTTP APIs.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title} ({Status})")]
|
||||
public class ProblemDetailsModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the URI reference that identifies the problem type.
|
||||
/// </summary>
|
||||
[JsonPropertyName("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a short, human-readable summary of the problem type.
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP status code generated by the server for this occurrence of the problem.
|
||||
/// </summary>
|
||||
[JsonPropertyName("status")]
|
||||
public int? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a detailed explanation specific to this occurrence of the problem.
|
||||
/// </summary>
|
||||
[JsonPropertyName("detail")]
|
||||
public string? Detail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a URI reference that identifies the specific occurrence of the problem.
|
||||
/// </summary>
|
||||
[JsonPropertyName("instance")]
|
||||
public string? Instance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets additional extension data that may be included with the problem details.
|
||||
/// This allows for including extra, non-standard fields in the problem details.
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, JsonElement>? Extensions { get; set; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rating.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Value}/{MaxValue}")]
|
||||
public abstract class RatingModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the numeric value of the rating.
|
||||
/// </summary>
|
||||
public decimal? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum possible rating value.
|
||||
/// </summary>
|
||||
public decimal? MaxValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional number of votes or reviews this rating is based on.
|
||||
/// </summary>
|
||||
public int? VoteCount { get; set; }
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get release information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{OriginalReleaseDate}")]
|
||||
public class ReleaseInfoModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the optional original release date of the media item.
|
||||
/// </summary>
|
||||
public DateOnly? OriginalReleaseDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional original release year of the media item.
|
||||
/// This is useful when only the year of original release is known.
|
||||
/// </summary>
|
||||
public int? OriginalReleaseYear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional re-release or reissue date of the media item.
|
||||
/// </summary>
|
||||
public DateOnly? ReReleaseDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional re-release or reissue year of the media item.
|
||||
/// </summary>
|
||||
public int? ReReleaseYear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional country or region of release.
|
||||
/// </summary>
|
||||
public string? ReleaseCountry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0")
|
||||
/// </summary>
|
||||
public string? ReleaseVersion { get; set; }
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get tag information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Name}")]
|
||||
public class TagModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the tag element of the media item.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Model for deserializing media settings.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{SECTION_NAME}")]
|
||||
public class EncryptionSettingsModel
|
||||
{
|
||||
public const string SECTION_NAME = "EncryptionSettings";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the root directory where media files are stored.
|
||||
/// </summary>
|
||||
public required string SecretKey { get; init; }
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Model for deserializing server configuration settings.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{SECTION_NAME}")]
|
||||
public class ServerConfigurationModel
|
||||
{
|
||||
public const string SECTION_NAME = "ServerConfiguration";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the remote API server path.
|
||||
/// </summary>
|
||||
public required char ApiVersion { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the remote API server path.
|
||||
/// </summary>
|
||||
public required string BaseAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the remote API server port.
|
||||
/// </summary>
|
||||
public required ushort Port { get; init; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for storing binary data (blob).
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{ContentType} (Data.Length)")]
|
||||
public class BlobDataModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the binary data as a byte array.
|
||||
/// </summary>
|
||||
public byte[] Data { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content type (MIME type) of the blob data, such as "image/png" for an image or "application/pdf" for a PDF document.
|
||||
/// </summary>
|
||||
public string ContentType { get; set; } = null!;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Model for directories displayed in custom directory/file browser dialogs.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Path}")]
|
||||
public class DirectoryModel : FileSystemItemModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the children items of the directory.
|
||||
/// </summary>
|
||||
public List<FileSystemItemModel> Items { get; set; } = [];
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Model for files displayed in custom directory/file browser dialogs.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Path}")]
|
||||
public class FileModel : FileSystemItemModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the size of the file, in bytes
|
||||
/// </summary>
|
||||
public long Size { get; set; }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Base model for files and directories displayed in custom directory/file browser dialogs.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Path}")]
|
||||
public abstract class FileSystemItemModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the full path to the file system item.
|
||||
/// </summary>
|
||||
public string? Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the file system item.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the creation date of the file system item.
|
||||
/// </summary>
|
||||
public DateTime DateCreated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the modification date of the file system item.
|
||||
/// </summary>
|
||||
public DateTime DateModified { get; set; }
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.FileSystem;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Generic file system node.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Path}")]
|
||||
public class FileSystemTreeNodeModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the full path of the file or directory.
|
||||
/// </summary>
|
||||
public string Path { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the file or directory.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the item, indicating whether it is a file, directory, or drive.
|
||||
/// </summary>
|
||||
public FileSystemItemType ItemType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the node is expanded.
|
||||
/// </summary>
|
||||
public bool IsExpanded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the child nodes have been loaded.
|
||||
/// </summary>
|
||||
public bool ChildrenLoaded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of child nodes.
|
||||
/// </summary>
|
||||
public List<FileSystemTreeNodeModel> Children { get; set; } = [];
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.FileSystem;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Model containing the file system platform type.
|
||||
/// </summary>`
|
||||
[DebuggerDisplay("{PlatformType}")]
|
||||
public class FileSystemTypeModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the file system platform type.
|
||||
/// </summary>
|
||||
public PlatformType PlatformType { get; set; }
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response to the inquiry about the existence of a file system path.
|
||||
/// </summary>
|
||||
/// <param name="Exists">Whether a file system path exists or not.</param>
|
||||
[DebuggerDisplay("{Exists}")]
|
||||
public record PathExistsModel(
|
||||
bool Exists
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response containing a file system path.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Path}")]
|
||||
public class PathSegmentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the returned path.
|
||||
/// </summary>
|
||||
public string Path { get; set; } = null!;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing a file system path separator.
|
||||
/// </summary>
|
||||
/// <param name="Separator">The system's path separator.</param>
|
||||
[DebuggerDisplay("{Separator}")]
|
||||
public record PathSeparatorModel(
|
||||
string Separator
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response to the inquiry about the validity of a file system path.
|
||||
/// </summary>
|
||||
/// <param name="IsValid">Whether a file system path is valid or not.</param>
|
||||
[DebuggerDisplay("{IsValid}")]
|
||||
public record PathValidModel(
|
||||
bool IsValid
|
||||
);
|
||||
@@ -1,56 +0,0 @@
|
||||
#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; }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#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; }
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Library;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Libraries;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a library element.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class LibraryModel
|
||||
{
|
||||
/// <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;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Libraries;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media library scan job progress model.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("CompletedItems: {CompletedItems}; TotalItems: {TotalItems}")]
|
||||
public class LibraryScanJobProgressModel
|
||||
{
|
||||
/// <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; }
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Libraries;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media library scan progress model.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("ScanId: {ScanId}; UserId: {UserId}; LibraryId: {LibraryId}")]
|
||||
public class LibraryScanProgressModel
|
||||
{
|
||||
/// <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 LibraryScanJobProgressModel? 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; }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#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; }
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Libraries;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media library scan response.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("ScanId: {ScanId} LibraryId: {LibraryId}")]
|
||||
public class ScanLibraryModel
|
||||
{
|
||||
/// <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; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.MediaContributors;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media contributor.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Name}")]
|
||||
public class MediaContributorModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the contributor.
|
||||
/// </summary>
|
||||
public MediaContributorNameModel? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the role of the contributor.
|
||||
/// </summary>
|
||||
public MediaContributorRoleModel? Role { get; set; }
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.MediaContributors;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media contributor name.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{DisplayName}")]
|
||||
public class MediaContributorNameModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name by which the contributor is popularly known.
|
||||
/// </summary>
|
||||
public string? DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the legal name of the contributor.
|
||||
/// </summary>
|
||||
public string? LegalName { get; set; }
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.MediaContributors;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a media contributor role.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Name}")]
|
||||
public class MediaContributorRoleModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the value representing this object.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the category of this object.
|
||||
/// </summary>
|
||||
public string? Category { get; set; }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a metadata provider configured for a media library.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public class LibraryMetadataProviderModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin providing the metadata.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display name of the metadata provider.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the metadata provider is enabled for the media library.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rank of the metadata provider, determining the order in which providers are tried.
|
||||
/// </summary>
|
||||
public int Rank { get; set; }
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Plugins;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a detected plugin.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public class PluginModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin.
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display name of the plugin.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the author of the plugin.
|
||||
/// </summary>
|
||||
public string Author { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version of the plugin.
|
||||
/// </summary>
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description of the plugin.
|
||||
/// </summary>
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the load status of the plugin.
|
||||
/// </summary>
|
||||
public PluginLoadStatus LoadStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error message when the plugin failed to load.
|
||||
/// </summary>
|
||||
public string? LoadError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the settings of the plugin.
|
||||
/// </summary>
|
||||
public Dictionary<string, string>? Settings { get; set; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Plugins;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Describes a single setting of a plugin.
|
||||
/// </summary>
|
||||
public class PluginSettingDescriptorModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique key of the setting.
|
||||
/// </summary>
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display label of the setting.
|
||||
/// </summary>
|
||||
public string Label { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the setting.
|
||||
/// </summary>
|
||||
public PluginSettingType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default value of the setting.
|
||||
/// </summary>
|
||||
public string? DefaultValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of allowed values, when the setting is a selection.
|
||||
/// </summary>
|
||||
public IReadOnlyList<string>? AllowedValues { get; set; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the settings of a plugin and their schema.
|
||||
/// </summary>
|
||||
public class PluginSettingsModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the schema of the plugin settings.
|
||||
/// </summary>
|
||||
public List<PluginSettingDescriptorModel> Schema { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current values of the plugin settings.
|
||||
/// </summary>
|
||||
public Dictionary<string, string>? Settings { get; set; }
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to reorder the metadata providers of a media library.
|
||||
/// </summary>
|
||||
public class ReorderLibraryMetadataProvidersModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Id of the media library whose metadata providers are reordered.
|
||||
/// </summary>
|
||||
public Guid LibraryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plugin Ids in the new order, from highest to lowest rank.
|
||||
/// </summary>
|
||||
public List<Guid> PluginIds { get; set; } = [];
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to enable or disable a metadata provider for a media library.
|
||||
/// </summary>
|
||||
public class SetLibraryMetadataProviderEnabledModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Id of the media library whose metadata provider is enabled or disabled.
|
||||
/// </summary>
|
||||
public Guid LibraryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin providing the metadata.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the metadata provider should be enabled for the media library.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to update the settings of a plugin.
|
||||
/// </summary>
|
||||
public class UpdatePluginSettingsModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the plugin.
|
||||
/// </summary>
|
||||
public Guid PluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the settings of the plugin.
|
||||
/// </summary>
|
||||
public Dictionary<string, string>? Settings { get; set; }
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for account password change.
|
||||
/// </summary>
|
||||
/// <param name="Username">The username of the account.</param>
|
||||
/// <param name="CurrentPassword">The current password of the account.</param>
|
||||
/// <param name="NewPassword">The new password of the account.</param>
|
||||
/// <param name="NewPasswordConfirm">The confirmation of the new password of the account.</param>
|
||||
public record ChangePasswordRequestModel(
|
||||
string? Username,
|
||||
string? CurrentPassword,
|
||||
string? NewPassword,
|
||||
string? NewPasswordConfirm
|
||||
);
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response model for an account password change request.
|
||||
/// </summary>
|
||||
/// <param name="IsPasswordChanged">Whether the password was changed or not.</param>
|
||||
[DebuggerDisplay("IsPasswordChanged: {IsPasswordChanged}")]
|
||||
public record ChangePasswordResponseModel(
|
||||
bool IsPasswordChanged
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Model for verifying the initialization status of the application.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("IsInitialized: {IsInitialized}")]
|
||||
public class InitializationModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the application has been run before, and the super admin account has been created.
|
||||
/// </summary>
|
||||
public bool IsInitialized { get; set; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for user authentication.
|
||||
/// </summary>
|
||||
/// <param name="Username">The username used to authenticate.</param>
|
||||
/// <param name="Password">The password used to authenticate.</param>
|
||||
/// <param name="TotpCode">The TOTP (Time-Based One-Time Password) code used for two-factor authentication.</param>
|
||||
/// <param name="ReturnUrl">The URL to return to, after login.</param>
|
||||
[DebuggerDisplay("Username: {Username}")]
|
||||
public record LoginRequestModel(
|
||||
string? Username = null,
|
||||
string? Password = null,
|
||||
string? TotpCode = null,
|
||||
string? ReturnUrl = null
|
||||
);
|
||||
@@ -1,21 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response model for a user authentication.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the logged in user.</param>
|
||||
/// <param name="Username">The username of the logged in user.</param>
|
||||
/// <param name="Token">The JWT authentication token, <see langword="null"/> if authentication failed or TOTP is required.</param>
|
||||
/// <param name="UsesTotp">Indicates whether the user has Two-Factor Authentication enabled, or not.</param>
|
||||
[DebuggerDisplay("Username: {Username}")]
|
||||
public record LoginResponseModel(
|
||||
Guid Id,
|
||||
string? Username,
|
||||
string? Token,
|
||||
bool UsesTotp
|
||||
);
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for account password recovery.
|
||||
/// </summary>
|
||||
/// <param name="Username">The username of the account for which to recover the password.</param>
|
||||
/// <param name="TotpCode">The TOTP (Time-Based One-Time Password) code used to recover the password.</param>
|
||||
[DebuggerDisplay("Username: {Username}")]
|
||||
public record RecoverPasswordRequestModel(
|
||||
string? Username,
|
||||
string? TotpCode
|
||||
);
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response model for an account password reset request.
|
||||
/// </summary>
|
||||
/// <param name="IsPasswordReset">Whether the password was reset or not.</param>
|
||||
[DebuggerDisplay("IsPasswordReset: {IsPasswordReset}")]
|
||||
public record RecoverPasswordResponseModel(
|
||||
bool IsPasswordReset
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request model for user registration.
|
||||
/// </summary>
|
||||
/// <param name="Username">The desired username for the new account.</param>
|
||||
/// <param name="Password">The password for the new account.</param>
|
||||
/// <param name="PasswordConfirm">The confirmation of the entered password, used to ensure consistency.</param>
|
||||
/// <param name="RegistrationType">Specifies the type of registration, e.g., "Admin" or "User".</param>
|
||||
/// <param name="Use2fa">Indicates whether two-factor authentication (2FA) should be enabled for the new account.</param>
|
||||
[DebuggerDisplay("Username: {Username}")]
|
||||
public record RegisterRequestModel(
|
||||
string? Username,
|
||||
string? Password,
|
||||
string? PasswordConfirm,
|
||||
string? RegistrationType,
|
||||
bool Use2fa = true
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response model for a successful registration.
|
||||
/// </summary>
|
||||
/// <param name="Username">The username of the registered user.</param>
|
||||
/// <param name="TotpSecret">The TOTP (Time-Based One-Time Password) secret used for two-factor authentication.</param>
|
||||
[DebuggerDisplay("Username: {Username}")]
|
||||
public record RegisterResponseModel(
|
||||
string? Username,
|
||||
string? TotpSecret
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a model for a user.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the user.</param>
|
||||
/// <param name="Username">The username of the user.</param>
|
||||
public record UserModel(
|
||||
Guid Id,
|
||||
string Username
|
||||
);
|
||||
@@ -1,33 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the settings of a user.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("IsPaginationEnabled: {IsPaginationEnabled}; ItemsPerPage: {ItemsPerPage}")]
|
||||
public class UserSettingsModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the user that owns these settings.
|
||||
/// </summary>
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether pagination is enabled for the user, or not.
|
||||
/// </summary>
|
||||
public bool IsPaginationEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of library items displayed per page when pagination is enabled.
|
||||
/// </summary>
|
||||
public int ItemsPerPage { get; set; } = 48;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the "The" prefix of library item titles is ignored by the alpha picker, or not.
|
||||
/// </summary>
|
||||
public bool IgnoreThePrefixForAlphaPicker { get; set; }
|
||||
}
|
||||
-216
@@ -1,216 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Models.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a book.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class BookModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the media item.
|
||||
/// </summary>
|
||||
public Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Id of the media library this book belongs to.
|
||||
/// </summary>
|
||||
public Guid LibraryId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file system path of the book.
|
||||
/// </summary>
|
||||
public string Path { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the media item.
|
||||
/// </summary>
|
||||
public string Title { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the original title of the media item.
|
||||
/// </summary>
|
||||
public string? OriginalTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional description of the media item.
|
||||
/// </summary>
|
||||
public string? Description { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional original release date of the media item.
|
||||
/// </summary>
|
||||
public DateOnly? OriginalReleaseDate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional original release year of the media item.
|
||||
/// This is useful when only the year of original release is known.
|
||||
/// </summary>
|
||||
public int? OriginalReleaseYear { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional re-release or reissue date of the media item.
|
||||
/// </summary>
|
||||
public DateOnly? ReReleaseDate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional re-release or reissue year of the media item.
|
||||
/// </summary>
|
||||
public int? ReReleaseYear { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional country or region of release.
|
||||
/// </summary>
|
||||
public string? ReleaseCountry { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0")
|
||||
/// </summary>
|
||||
public string? ReleaseVersion { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ISO 639-1 two-letter language code.
|
||||
/// </summary>
|
||||
public string? LanguageCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full name of the language in English.
|
||||
/// </summary>
|
||||
public string? LanguageName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an optional native name of the language.
|
||||
/// </summary>
|
||||
public string? LanguageNativeName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional ISO 639-1 two-letter original language code.
|
||||
/// </summary>
|
||||
public string? OriginalLanguageCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional full name of the original language in English.
|
||||
/// </summary>
|
||||
public string? OriginalLanguageName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an optional native name of the original language.
|
||||
/// </summary>
|
||||
public string? OriginalLanguageNativeName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of tags associated with the media item.
|
||||
/// </summary>
|
||||
public HashSet<TagModel> Tags { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of genres associated with the media item.
|
||||
/// </summary>
|
||||
public HashSet<GenreModel> Genres { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the publisher of the written content.
|
||||
/// </summary>
|
||||
public string? Publisher { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of pages in the written content.
|
||||
/// </summary>
|
||||
public int? PageCount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the format of the book (e.g., Hardcover, Paperback), if applicable.
|
||||
/// </summary>
|
||||
public string Format { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the edition of the book, if applicable.
|
||||
/// </summary>
|
||||
public string? Edition { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the volume or book number in the series, if applicable.
|
||||
/// </summary>
|
||||
public int? VolumeNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the series id, if the book is part of a series.
|
||||
/// </summary>
|
||||
//public Guid? BookSeriesId { get; init; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ASIN (Amazon Standard Identification Number) of the book.
|
||||
/// </summary>
|
||||
public string? ASIN { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Goodreads ID of the book.
|
||||
/// </summary>
|
||||
public string? GoodreadsId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Library of Congress Control Number (LCCN) of the book.
|
||||
/// </summary>
|
||||
public string? LCCN { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the OCLC Number (WorldCat identifier) of the book.
|
||||
/// </summary>
|
||||
public string? OCLCNumber { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Open Library ID of the book.
|
||||
/// </summary>
|
||||
public string? OpenLibraryId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the LibraryThing ID of the book.
|
||||
/// </summary>
|
||||
public string? LibraryThingId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Google Books ID of the book.
|
||||
/// </summary>
|
||||
public string? GoogleBooksId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Barnes & Noble ID of the book.
|
||||
/// </summary>
|
||||
public string? BarnesAndNobleId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Apple Books ID of the book.
|
||||
/// </summary>
|
||||
public string? AppleBooksId { get; init; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of ISBN (International Standard Book Number) of the book.
|
||||
/// </summary>
|
||||
public List<IsbnModel> ISBNs { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of media contributors (actors, directors, etc) starring in this book.
|
||||
/// </summary>
|
||||
//public List<ContributorIdModel> ContributorIds { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of ratings for this book.
|
||||
/// </summary>
|
||||
public List<BookRatingModel> Ratings { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time and date when the entity was added.
|
||||
/// </summary>
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional time and date when the entity was updated.
|
||||
/// </summary>
|
||||
public DateTime? Updated { get; set; }
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
|
||||
using Lumina.Presentation.Web.Common.Models.Common;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a book rating.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Value}/{MaxValue}")]
|
||||
public class BookRatingModel : RatingModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the source of the book rating (e.g., a specific website or platform).
|
||||
/// </summary>
|
||||
public BookRatingSource? Source { get; set; }
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get book series information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class BookSeriesModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the title of the book series.
|
||||
/// </summary>
|
||||
public string? Title { get; set; }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Models.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a book.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class BooksModel
|
||||
{
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get ISBN information.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Value} ({Format})")]
|
||||
public class IsbnModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ISBN value.
|
||||
/// </summary>
|
||||
public string? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the format of the ISBN (e.g., ISBN-10 or ISBN-13).
|
||||
/// </summary>
|
||||
public IsbnFormat? Format { get; set; }
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a preview of important properties of a book.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class LightBookModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the media item.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the media item.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional release year (either re-release year, if available, or original release year, if known) of the media item.
|
||||
/// </summary>
|
||||
public int? ReleaseYear { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional path of the image representing the cover of this book.
|
||||
/// </summary>
|
||||
public string? CoverPath { get; init; }
|
||||
}
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Models.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Models.WrittenContentLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Represents written content metadata.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Title}")]
|
||||
public class WrittenContentMetadataModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the title of the written content.
|
||||
/// </summary>
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original title of the written content, if different from the current title.
|
||||
/// </summary>
|
||||
public string? OriginalTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a brief description or summary of the written content.
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the release information, including release date and other relevant details.
|
||||
/// </summary>
|
||||
public ReleaseInfoModel? ReleaseInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of genres associated with the written content.
|
||||
/// </summary>
|
||||
public List<GenreModel>? Genres { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of tags that further describe or categorize the written content.
|
||||
/// </summary>
|
||||
public List<TagModel>? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language in which the written content is written.
|
||||
/// </summary>
|
||||
public LanguageInfoModel? Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original language of the written content, if it has been translated.
|
||||
/// </summary>
|
||||
public LanguageInfoModel? OriginalLanguage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the publisher of the written content.
|
||||
/// </summary>
|
||||
public string? Publisher { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of pages in the written content.
|
||||
/// </summary>
|
||||
public int? PageCount { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user