Enforces XML documentation on public members.

This commit is contained in:
BinaryAlley committed 2026-11-16 20:16:23 +02:00
1 parent 0daef2acab
commit 308402ad0e
202 files changed
+3901 -98

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
<Project>
<!-- Shared warning and documentation policy for every production project under src. -->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>$(WarningsAsErrors);CS1591</WarningsAsErrors><!--Public members must have XML documentation.-->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project>
@@ -142,9 +142,9 @@ public class BookEntity : IStorageEntity, IAuditableEntity
/// </summary>
public float? VolumeNumber { get; set; }
// TODO: uncomment when series is implemented.
/// <summary>
/// Gets or sets the series id, if the book is part of a series.
/// </summary>
///// <summary>
///// Gets or sets the series id, if the book is part of a series.
///// </summary>
//public Guid? BookSeriesId { get; set; }
/// <summary>
@@ -183,7 +183,7 @@ public class BookEntity : IStorageEntity, IAuditableEntity
public string? GoogleBooksId { get; set; }
/// <summary>
/// Gets or sets the Barnes & Noble ID of the book.
/// Gets or sets the Barnes &amp; Noble ID of the book.
/// </summary>
public string? BarnesAndNobleId { get; set; }
@@ -23,6 +23,7 @@ public interface ILibraryScanRepository : IRepository<LibraryScanEntity>,
/// <summary>
/// Gets the media library scans that belong to a media library identified by <paramref name="libraryId"/>, for the previous month, from the storage medium.
/// </summary>
/// <param name="libraryId">The unique identifier of the media library whose scans are retrieved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="LibraryScanEntity"/>, or an error.</returns>
Task<Result<IEnumerable<LibraryScanEntity>>> GetPastMonthScansByLibraryIdAsync(Guid libraryId, CancellationToken cancellationToken);
@@ -9,25 +9,99 @@ namespace Lumina.Application.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Error types for application authentication operations.
/// </summary>
public static class Authentication
{
/// <summary>
/// Gets the error that reports that a username already exists.
/// </summary>
public static Error UsernameAlreadyExists => Error.Conflict(description: nameof(UsernameAlreadyExists));
/// <summary>
/// Gets the error that reports that a username does not exist.
/// </summary>
public static Error UsernameDoesNotExist => Error.NotFound(description: nameof(UsernameDoesNotExist));
/// <summary>
/// Gets the error that reports that a username cannot be empty.
/// </summary>
public static Error UsernameCannotBeEmpty => Error.Validation(description: nameof(UsernameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a time-based one-time password cannot be empty.
/// </summary>
public static Error TotpCannotBeEmpty => Error.Validation(description: nameof(TotpCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a password cannot be empty.
/// </summary>
public static Error PasswordCannotBeEmpty => Error.Validation(description: nameof(PasswordCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a new password cannot be empty.
/// </summary>
public static Error NewPasswordCannotBeEmpty => Error.Validation(description: nameof(NewPasswordCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a current password cannot be empty.
/// </summary>
public static Error CurrentPasswordCannotBeEmpty => Error.Validation(description: nameof(CurrentPasswordCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a password confirmation cannot be empty.
/// </summary>
public static Error PasswordConfirmCannotBeEmpty => Error.Validation(description: nameof(PasswordConfirmCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a new password confirmation cannot be empty.
/// </summary>
public static Error NewPasswordConfirmCannotBeEmpty => Error.Validation(description: nameof(NewPasswordConfirmCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a password is invalid.
/// </summary>
public static Error InvalidPassword => Error.Validation(description: nameof(InvalidPassword));
/// <summary>
/// Gets the error that reports that a username must be between 3 and 255 characters long.
/// </summary>
public static Error UsernameMustBeBetween3And255CharactersLong => Error.Validation(description: nameof(UsernameMustBeBetween3And255CharactersLong));
/// <summary>
/// Gets the error that reports that a username is invalid.
/// </summary>
public static Error InvalidUsername => Error.Validation(description: nameof(InvalidUsername));
/// <summary>
/// Gets the error that reports that a password and its confirmation do not match.
/// </summary>
public static Error PasswordsNotMatch => Error.Validation(description: nameof(PasswordsNotMatch));
/// <summary>
/// Gets the error that reports that a time-based one-time password code is invalid.
/// </summary>
public static Error InvalidTotpCode => Error.Validation(description: nameof(InvalidTotpCode));
/// <summary>
/// Gets the error that reports that the combination of a username and a password is invalid.
/// </summary>
public static Error InvalidUsernameOrPassword => Error.Failure(description: nameof(InvalidUsernameOrPassword));
/// <summary>
/// Gets the error that reports that a current password is invalid.
/// </summary>
public static Error InvalidCurrentPassword => Error.Failure(description: nameof(InvalidCurrentPassword));
/// <summary>
/// Gets the error that reports that a temporary password has expired.
/// </summary>
public static Error TempPasswordExpired => Error.Failure(description: nameof(TempPasswordExpired));
/// <summary>
/// Gets the error that reports that a password reset has already been requested.
/// </summary>
public static Error PasswordResetAlreadyRequested => Error.Failure(description: nameof(PasswordResetAlreadyRequested));
}
}
@@ -9,24 +9,94 @@ namespace Lumina.Application.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Error types for application authorization operations.
/// </summary>
public static class Authorization
{
/// <summary>
/// Gets the error that reports that the caller is not authorized to perform the operation.
/// </summary>
public static Error NotAuthorized => Error.Unauthorized(description: nameof(NotAuthorized));
/// <summary>
/// Gets the error that reports that the administrator account has already been created.
/// </summary>
public static Error AdminAccountAlreadyCreated => Error.Conflict(description: nameof(AdminAccountAlreadyCreated));
/// <summary>
/// Gets the error that reports that the administrator account does not exist.
/// </summary>
public static Error AdminAccountNotFound => Error.NotFound(description: nameof(AdminAccountNotFound));
/// <summary>
/// Gets the error that reports that the administrator role does not exist.
/// </summary>
public static Error AdminRoleNotFound => Error.NotFound(description: nameof(AdminRoleNotFound));
/// <summary>
/// Gets the error that reports that the administrator role cannot be deleted.
/// </summary>
public static Error AdminRoleCannotBeDeleted => Error.Forbidden(description: nameof(AdminRoleCannotBeDeleted));
/// <summary>
/// Gets the error that reports that a role does not exist.
/// </summary>
public static Error RoleNotFound => Error.NotFound(description: nameof(RoleNotFound));
/// <summary>
/// Gets the error that reports that a permission does not exist.
/// </summary>
public static Error PermissionNotFound => Error.NotFound(description: nameof(PermissionNotFound));
/// <summary>
/// Gets the error that reports that a permission already exists.
/// </summary>
public static Error PermissionAlreadyExists => Error.Conflict(description: nameof(PermissionAlreadyExists));
/// <summary>
/// Gets the error that reports that a role already exists.
/// </summary>
public static Error RoleAlreadyExists => Error.Conflict(description: nameof(RoleAlreadyExists));
/// <summary>
/// Gets the error that reports that a role identifier cannot be empty.
/// </summary>
public static Error RoleIdCannotBeEmpty => Error.Validation(description: nameof(RoleIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a permissions list cannot be <see langword="null"/>.
/// </summary>
public static Error PermissionsListCannotBeNull => Error.Validation(description: nameof(PermissionsListCannotBeNull));
/// <summary>
/// Gets the error that reports that a permissions list cannot be empty.
/// </summary>
public static Error PermissionsListCannotBeEmpty => Error.Validation(description: nameof(PermissionsListCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a permission identifier cannot be empty.
/// </summary>
public static Error PermissionIdCannotBeEmpty => Error.Validation(description: nameof(PermissionIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a role name cannot be empty.
/// </summary>
public static Error RoleNameCannotBeEmpty => Error.Validation(description: nameof(RoleNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a role name cannot be <see langword="null"/>.
/// </summary>
public static Error RoleNameCannotBeNull => Error.Validation(description: nameof(RoleNameCannotBeNull));
/// <summary>
/// Gets the error that reports that the last administrator account cannot be removed.
/// </summary>
public static Error CannotRemoveLastAdmin => Error.Forbidden(description: nameof(CannotRemoveLastAdmin));
/// <summary>
/// Gets the error that reports that a user must have a role or direct permissions.
/// </summary>
public static Error UserMustHaveRoleOrDirectPermissions => Error.Forbidden(description: nameof(UserMustHaveRoleOrDirectPermissions));
}
}
@@ -9,11 +9,29 @@ namespace Lumina.Application.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Error types for application persistence operations.
/// </summary>
public static class Persistence
{
/// <summary>
/// Gets the error that reports that a media library could not be persisted.
/// </summary>
public static Error ErrorPersistingMediaLibrary => Error.Failure(description: nameof(ErrorPersistingMediaLibrary));
/// <summary>
/// Gets the error that reports that an authorization role could not be persisted.
/// </summary>
public static Error ErrorPersistingAuthorizationRole => Error.Failure(description: nameof(ErrorPersistingAuthorizationRole));
/// <summary>
/// Gets the error that reports that a unique constraint was violated.
/// </summary>
public static Error UniqueConstraintViolation => Error.Conflict(description: nameof(UniqueConstraintViolation));
/// <summary>
/// Gets the error that reports that a concurrency conflict occurred while persisting changes.
/// </summary>
public static Error ConcurrencyConflict => Error.Conflict(description: nameof(ConcurrencyConflict));
}
}
@@ -10,6 +10,9 @@ namespace Lumina.Application.Common.Infrastructure.Models.DTO.Configuration;
[DebuggerDisplay("{SECTION_NAME}")]
public class MediaSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the media settings.
/// </summary>
public const string SECTION_NAME = "MediaSettings";
/// <summary>
@@ -10,6 +10,9 @@ namespace Lumina.Application.Common.Infrastructure.Models.DTO.Configuration;
[DebuggerDisplay("{SECTION_NAME}")]
public class PluginsSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the plugins settings.
/// </summary>
public const string SECTION_NAME = "PluginsSettings";
/// <summary>
@@ -54,7 +54,7 @@ public static class FileSystemItemMapping
}
/// <summary>
/// Converts <paramref name="domainEntities"/> to <see cref="IEnumerable<FileSystemTreeNodeResponse>"/>.
/// Converts <paramref name="domainEntities"/> to a collection of <see cref="FileSystemTreeNodeResponse"/>.
/// </summary>
/// <param name="domainEntities">The domain entities to be converted.</param>
/// <returns>The converted entities.</returns>
@@ -11,7 +11,7 @@ namespace Lumina.Application.Common.Mapping.FileSystemManagement.Files;
public static class GetTreeFilesRequestMapping
{
/// <summary>
/// Converts <paramref name="request"/> to <see cref="GetTreeDirectoriesQuery"/>.
/// Converts <paramref name="request"/> to <see cref="GetTreeFilesQuery"/>.
/// </summary>
/// <param name="request">The request to be converted.</param>
/// <returns>The converted query.</returns>
@@ -346,7 +346,7 @@ public static class ValidatorUtilities
/// </summary>
/// <remarks>
/// If the property is <see langword="null"/> or not a string, this rule fails (use
/// <see cref="When{TRequest, TProperty}(IRuleBuilder{TRequest, TProperty}, Func{TRequest, bool})"/> to skip optional properties).
/// <c>When</c> to skip optional properties).
/// </remarks>
/// <typeparam name="TRequest">The type of the request being validated.</typeparam>
/// <typeparam name="TProperty">The type of the property being validated.</typeparam>
@@ -165,7 +165,7 @@ public class GetResumePointQueryHandler : IQueryHandler<GetResumePointQuery, Res
/// Commits the deletion of a stale or orphan resume point, so that the cleanup survives the not-found response of this query.
/// </summary>
/// <remarks>
/// The request transaction is committed by <see cref="EventualConsistencyMiddleware"/> only when the response is a success, and this query intentionally
/// The request transaction is committed by the <c>EventualConsistencyMiddleware</c> only when the response is a success, and this query intentionally
/// responds with a not-found error after it cleans up, so the deletion is committed here. A failed save has nothing to persist, and a concurrency
/// conflict means that the row is already gone, which is the desired outcome. Committing when no transaction is open is a no-op, which keeps the handler usable outside of the HTTP pipeline.
/// </remarks>
@@ -4,7 +4,7 @@ namespace Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Playbac
/// Defines the format of the opaque delivery handle of a playback manifest.
/// </summary>
/// <remarks>
/// A handle is a <see cref="Guid"/> rendered with the <c>N</c> format: exactly 32 lowercase hexadecimal characters, with no separator. Every producer
/// A handle is a <see cref="System.Guid"/> rendered with the <c>N</c> format: exactly 32 lowercase hexadecimal characters, with no separator. Every producer
/// and consumer of a handle uses this rule, so a handle is never silently normalized into another value.
/// </remarks>
public static class PlaybackDeliveryId
@@ -28,7 +28,7 @@ namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary
/// <param name="OpenLibraryId">The Open Library ID of the book, if applicable.</param>
/// <param name="LibraryThingId">The LibraryThing ID of the book, if applicable.</param>
/// <param name="GoogleBooksId">The Google Books ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes &amp; Noble ID of the book, if applicable.</param>
/// <param name="AppleBooksId">The Apple Books ID of the book, if applicable.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book.</param>
/// <param name="Contributors">The list of media contributors that contributed to this book.</param>
@@ -28,7 +28,7 @@ namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary
/// <param name="OpenLibraryId">The Open Library ID of the book, if applicable.</param>
/// <param name="LibraryThingId">The LibraryThing ID of the book, if applicable.</param>
/// <param name="GoogleBooksId">The Google Books ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes &amp; Noble ID of the book, if applicable.</param>
/// <param name="AppleBooksId">The Apple Books ID of the book, if applicable.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book.</param>
/// <param name="Contributors">The list of media contributors that contributed to this book.</param>
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -7,6 +7,7 @@ namespace Lumina.Contracts.DTO.MediaLibrary.Management;
/// <summary>
/// Data transfer object for a media library content location.
/// </summary>
/// <param name="Path">The file system path of the content location.</param>
[DebuggerDisplay("Path: {Path}")]
public record LibraryContentLocationDto(
string Path
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -26,7 +26,7 @@ namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibra
/// <param name="OpenLibraryId">The Open Library Id of the book. Optional.</param>
/// <param name="LibraryThingId">The LibraryThing Id of the book. Optional.</param>
/// <param name="GoogleBooksId">The Google Books Id of the book. Optional.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble Id of the book. Optional.</param>
/// <param name="BarnesAndNobleId">The Barnes &amp; Noble Id of the book. Optional.</param>
/// <param name="AppleBooksId">The Apple Books Id of the book. Optional.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book. Required.</param>
/// <param name="Contributors">The list of media contributors of the book. Required.</param>
@@ -24,7 +24,7 @@ namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibra
/// <param name="OpenLibraryId">The Open Library Id of the book. Optional.</param>
/// <param name="LibraryThingId">The LibraryThing Id of the book. Optional.</param>
/// <param name="GoogleBooksId">The Google Books Id of the book. Optional.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble Id of the book. Optional.</param>
/// <param name="BarnesAndNobleId">The Barnes &amp; Noble Id of the book. Optional.</param>
/// <param name="AppleBooksId">The Apple Books Id of the book. Optional.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book. Required.</param>
/// <param name="Contributors">The list of media contributors of the book. Required.</param>
@@ -29,7 +29,7 @@ namespace Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibr
/// <param name="OpenLibraryId">The Open Library ID of the book, if applicable.</param>
/// <param name="LibraryThingId">The LibraryThing ID of the book, if applicable.</param>
/// <param name="GoogleBooksId">The Google Books ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes &amp; Noble ID of the book, if applicable.</param>
/// <param name="AppleBooksId">The Apple Books ID of the book, if applicable.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book.</param>
/// <param name="Contributors">The list of references to the media contributors that contributed to this book, each with the role they played.</param>
@@ -4,7 +4,7 @@ using System.Diagnostics;
namespace Lumina.Contracts.Responses.UsersManagement;
/// </summary>
/// <summary>
/// Represents a response for verifying the initialization status of the application.
/// </summary>
/// <param name="IsInitialized">Indicates whether the application has been run before, and the super admin account has been created.</param>
@@ -11,7 +11,7 @@ namespace Lumina.DataAccess.Common.Dapper;
/// </summary>
/// <remarks>
/// The SQLite provider stores <see cref="Guid"/> columns as upper case TEXT. Dapper falls back to Convert.ChangeType when materializing
/// such columns into <see cref="Guid"/> properties. <see cref="Guid"/> has no string <see cref="TypeConverter"/>, so that conversion
/// such columns into <see cref="Guid"/> properties. <see cref="Guid"/> has no string <see cref="System.ComponentModel.TypeConverter"/>, so that conversion
/// throws an <see cref="InvalidCastException"/>; this handler performs the conversion explicitly instead, and writes the same upper case
/// representation so raw key comparisons and foreign keys match the rows created by Entity Framework.
/// </remarks>
@@ -124,6 +124,8 @@ internal sealed class RoleRepository : IRoleRepository
/// Gets a <see cref="RoleEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the authorization role to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the role should be loaded together with the role itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved role should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="RoleEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<RoleEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -88,6 +88,8 @@ internal sealed class BookRepository : IBookRepository
/// Gets a book by its Id.
/// </summary>
/// <param name="id">The Id of the book to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the book should be loaded together with the book itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved book should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="BookEntity"/>, or an error.</returns>
public async Task<Result<BookEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -54,6 +54,8 @@ internal sealed class LibraryRepository : ILibraryRepository
/// Gets a <see cref="LibraryEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The Id of the library to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the library should be loaded together with the library itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved library should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="LibraryEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<LibraryEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -53,6 +53,8 @@ internal sealed class LibraryScanRepository : ILibraryScanRepository
/// Gets a <see cref="LibraryScanEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the library scan to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the library scan should be loaded together with the library scan itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved library scan should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="LibraryScanEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<LibraryScanEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -71,6 +73,7 @@ internal sealed class LibraryScanRepository : ILibraryScanRepository
/// <summary>
/// Gets the media library scans that belong to a media library identified by <paramref name="libraryId"/>, for the previous month, from the storage medium.
/// </summary>
/// <param name="libraryId">The Id of the media library whose scans are retrieved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="LibraryScanEntity"/>, or an error.</returns>
public async Task<Result<IEnumerable<LibraryScanEntity>>> GetPastMonthScansByLibraryIdAsync(Guid libraryId, CancellationToken cancellationToken)
@@ -37,6 +37,8 @@ internal sealed class PluginRepository : IPluginRepository
/// Gets a plugin by its Id.
/// </summary>
/// <param name="id">The Id of the plugin to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the plugin should be loaded together with the plugin itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved plugin should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="PluginEntity"/>, or an error.</returns>
public async Task<Result<PluginEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -35,6 +35,8 @@ internal sealed class ScheduledJobExecutionRepository : IScheduledJobExecutionRe
/// Gets an execution identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the execution to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the execution should be loaded together with the execution itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved execution should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="ScheduledJobExecutionEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<ScheduledJobExecutionEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -39,6 +39,8 @@ internal sealed class ScheduledJobRepository : IScheduledJobRepository
/// Gets a scheduled job identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the scheduled job to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the scheduled job should be loaded together with the scheduled job itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved scheduled job should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="ScheduledJobEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<ScheduledJobEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -180,6 +180,8 @@ internal sealed class UserRepository : IUserRepository
/// Gets a <see cref="UserEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the user to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the user should be loaded together with the user itself.</param>
/// <param name="shouldTrackEntities">Whether the retrieved user should be tracked by the persistence medium, so that changes to it can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a <see cref="UserEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<UserEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -50,6 +50,8 @@ internal sealed class UserSettingsRepository : IUserSettingsRepository
/// Gets the settings identified by <paramref name="id"/>, if they exist.
/// </summary>
/// <param name="id">The Id of the user settings to get.</param>
/// <param name="shouldIncludeNavigationProperties">Whether the navigation properties of the user settings should be loaded together with the user settings themselves.</param>
/// <param name="shouldTrackEntities">Whether the retrieved user settings should be tracked by the persistence medium, so that changes to them can be saved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either the <see cref="UserSettingsEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<Result<UserSettingsEntity?>> GetByIdAsync(Guid id, bool shouldIncludeNavigationProperties = true, bool shouldTrackEntities = true, CancellationToken cancellationToken = default)
@@ -30,7 +30,7 @@ public class DataSeedService : IDataSeedService
/// <summary>
/// Initializes a new instance of the <see cref="DataSeedService"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="dateTimeProvider">Injected service for time related concerns.</param>
public DataSeedService(IUnitOfWork unitOfWork, IDateTimeProvider dateTimeProvider)
{
@@ -23,39 +23,174 @@ namespace Lumina.DataAccess.Core.UoW;
/// <remarks>To update the database: update-database -p Lumina.DataAccess -s Lumina.Presentation.Api</remarks>
public class LuminaDbContext : DbContext
{
/// <summary>
/// Gets or sets the books stored in the database.
/// </summary>
public virtual DbSet<BookEntity> Books { get; set; } = null!;
/// <summary>
/// Gets or sets the artists stored in the database.
/// </summary>
public virtual DbSet<ArtistEntity> Artists { get; set; } = null!;
/// <summary>
/// Gets or sets the albums stored in the database.
/// </summary>
public virtual DbSet<AlbumEntity> Albums { get; set; } = null!;
/// <summary>
/// Gets or sets the tracks stored in the database.
/// </summary>
public virtual DbSet<TrackEntity> Tracks { get; set; } = null!;
/// <summary>
/// Gets or sets the artwork of the music library items stored in the database.
/// </summary>
public virtual DbSet<MusicArtworkEntity> MusicArtwork { get; set; } = null!;
/// <summary>
/// Gets or sets the metadata extracted from the music files discovered during a scan, stored in the database.
/// </summary>
public virtual DbSet<MusicLibraryScanItemMetadataEntity> MusicLibraryScanItemMetadata { get; set; } = null!;
/// <summary>
/// Gets or sets the users stored in the database.
/// </summary>
public virtual DbSet<UserEntity> Users { get; set; } = null!;
/// <summary>
/// Gets or sets the settings of the users stored in the database.
/// </summary>
public virtual DbSet<UserSettingsEntity> UserSettings { get; set; } = null!;
/// <summary>
/// Gets or sets the media libraries stored in the database.
/// </summary>
public virtual DbSet<LibraryEntity> Libraries { get; set; } = null!;
/// <summary>
/// Gets or sets the scans of the media libraries stored in the database.
/// </summary>
public virtual DbSet<LibraryScanEntity> LibraryScans { get; set; } = null!;
/// <summary>
/// Gets or sets the results of the media library scans stored in the database.
/// </summary>
public virtual DbSet<LibraryScanResultEntity> LibraryScanResults { get; set; } = null!;
/// <summary>
/// Gets or sets the snapshots of the media library items produced by the scans, stored in the database.
/// </summary>
public virtual DbSet<LibraryScanSnapshotEntity> LibraryScanSnapshots { get; set; } = null!;
/// <summary>
/// Gets or sets the staging results of the media library scans, holding the discovered file system items, stored in the database.
/// </summary>
public virtual DbSet<LibraryScanStagingResultsEntity> LibraryScanStagingResults { get; set; } = null!;
/// <summary>
/// Gets or sets the fingerprints of the scanned directories, holding their last write time, stored in the database.
/// </summary>
public virtual DbSet<DirectoryScanFingerprintEntity> DirectoryScanFingerprints { get; set; } = null!;
/// <summary>
/// Gets or sets the authorization roles stored in the database.
/// </summary>
public virtual DbSet<RoleEntity> Roles { get; set; } = null!;
/// <summary>
/// Gets or sets the associations between users and roles stored in the database.
/// </summary>
public virtual DbSet<UserRoleEntity> UserRoles { get; set; } = null!;
/// <summary>
/// Gets or sets the authorization permissions stored in the database.
/// </summary>
public virtual DbSet<PermissionEntity> Permissions { get; set; } = null!;
/// <summary>
/// Gets or sets the associations between users and permissions stored in the database.
/// </summary>
public virtual DbSet<UserPermissionEntity> UserPermissions { get; set; } = null!;
/// <summary>
/// Gets or sets the associations between roles and permissions stored in the database.
/// </summary>
public virtual DbSet<RolePermissionEntity> RolePermissions { get; set; } = null!;
/// <summary>
/// Gets or sets the plugins stored in the database.
/// </summary>
public virtual DbSet<PluginEntity> Plugins { get; set; } = null!;
/// <summary>
/// Gets or sets the metadata provider configurations of the media libraries stored in the database.
/// </summary>
public virtual DbSet<LibraryMetadataProviderConfigurationEntity> LibraryMetadataProviderConfigurations { get; set; } = null!;
/// <summary>
/// Gets or sets the artwork provider configurations of the media libraries stored in the database.
/// </summary>
public virtual DbSet<LibraryArtworkProviderConfigurationEntity> LibraryArtworkProviderConfigurations { get; set; } = null!;
/// <summary>
/// Gets or sets the book reader configurations of the media libraries stored in the database.
/// </summary>
public virtual DbSet<LibraryBookReaderConfigurationEntity> LibraryBookReaderConfigurations { get; set; } = null!;
/// <summary>
/// Gets or sets the themes stored in the database.
/// </summary>
public virtual DbSet<ThemeEntity> Themes { get; set; } = null!;
/// <summary>
/// Gets or sets the media contributors stored in the database.
/// </summary>
public virtual DbSet<MediaContributorEntity> MediaContributors { get; set; } = null!;
/// <summary>
/// Gets or sets the participations of the media contributors in books stored in the database.
/// </summary>
public virtual DbSet<BookContributorEntity> BookContributors { get; set; } = null!;
/// <summary>
/// Gets or sets the scheduled jobs stored in the database.
/// </summary>
public virtual DbSet<ScheduledJobEntity> ScheduledJobs { get; set; } = null!;
/// <summary>
/// Gets or sets the executions of the scheduled jobs stored in the database.
/// </summary>
public virtual DbSet<ScheduledJobExecutionEntity> ScheduledJobExecutions { get; set; } = null!;
/// <summary>
/// Gets or sets the display preferences of the scheduler page of the users stored in the database.
/// </summary>
public virtual DbSet<SchedulerDisplayPreferencesEntity> SchedulerDisplayPreferences { get; set; } = null!;
/// <summary>
/// Gets or sets the playlists stored in the database.
/// </summary>
public virtual DbSet<PlaylistEntity> Playlists { get; set; } = null!;
/// <summary>
/// Gets or sets the entries of the playlists stored in the database.
/// </summary>
public virtual DbSet<PlaylistEntryEntity> PlaylistEntries { get; set; } = null!;
/// <summary>
/// Gets or sets the favorites stored in the database.
/// </summary>
public virtual DbSet<FavoriteEntity> Favorites { get; set; } = null!;
/// <summary>
/// Gets or sets the media consumption records stored in the database.
/// </summary>
public virtual DbSet<MediaConsumptionRecordEntity> MediaConsumptionRecords { get; set; } = null!;
/// <summary>
/// Gets or sets the media resume points stored in the database.
/// </summary>
public virtual DbSet<MediaResumePointEntity> MediaResumePoints { get; set; } = null!;
/// <summary>
@@ -198,6 +198,9 @@ public class UnitOfWork : IUnitOfWork, IDisposable
}
}
/// <summary>
/// Gets the media contributor repository.
/// </summary>
public IMediaContributorRepository MediaContributorRepository
{
get
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -5,9 +5,28 @@ namespace Lumina.Domain.SharedKernel.Common.Enums.Authorization;
/// </summary>
public enum AuthorizationPermission
{
/// <summary>
/// No permission is granted.
/// </summary>
None = 0,
/// <summary>
/// Permission to view the existing users.
/// </summary>
CanViewUsers,
/// <summary>
/// Permission to delete the existing users.
/// </summary>
CanDeleteUsers,
/// <summary>
/// Permission to register new users.
/// </summary>
CanRegisterUsers,
/// <summary>
/// Permission to create and manage media libraries.
/// </summary>
CanCreateLibraries
}
@@ -101,7 +101,7 @@ public enum LibraryType
LiveRecordingVideo,
/// <summary>
/// Recorded conversations and Q&A sessions in video format.
/// Recorded conversations and Q&amp;A sessions in video format.
/// </summary>
InterviewVideo,
@@ -131,7 +131,7 @@ public enum LibraryType
LiveRecordingAudio,
/// <summary>
/// Recorded conversations and Q&A sessions in audio format.
/// Recorded conversations and Q&amp;A sessions in audio format.
/// </summary>
InterviewAudio,
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -9,14 +9,44 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report favorite rule violations and missing favorites.
/// </summary>
public static class Favorites
{
/// <summary>
/// Gets the error that reports that the requested favorite was not found.
/// </summary>
public static Error FavoriteNotFound => Error.NotFound(description: nameof(FavoriteNotFound));
/// <summary>
/// Gets the error that reports that the user already has the media item in favorites.
/// </summary>
public static Error FavoriteAlreadyExists => Error.Conflict(description: nameof(FavoriteAlreadyExists));
/// <summary>
/// Gets the error that reports that the favorite media kind is not a defined value.
/// </summary>
public static Error FavoriteMediaKindIsInvalid => Error.Validation(description: nameof(FavoriteMediaKindIsInvalid));
/// <summary>
/// Gets the error that reports that the media kind cannot be favorited because no library provides it yet.
/// </summary>
public static Error FavoriteMediaKindIsNotSupported => Error.Validation(description: nameof(FavoriteMediaKindIsNotSupported));
/// <summary>
/// Gets the error that reports that the media item identifier of the favorite cannot be empty.
/// </summary>
public static Error FavoriteMediaItemIdCannotBeEmpty => Error.Validation(description: nameof(FavoriteMediaItemIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the list of media item identifiers cannot be empty.
/// </summary>
public static Error FavoriteMediaItemIdsCannotBeEmpty => Error.Validation(description: nameof(FavoriteMediaItemIdsCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the list of media item identifiers exceeds the maximum allowed count.
/// </summary>
public static Error FavoriteMediaItemIdsExceedMaximumCount => Error.Validation(description: nameof(FavoriteMediaItemIdsExceedMaximumCount));
}
}
@@ -9,28 +9,114 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report file system navigation, validation and operation failures.
/// </summary>
public static class FileSystemManagement
{
/// <summary>
/// Gets the error that reports that a file system operation failed because its parent node is <see langword="null"/>.
/// </summary>
public static Error ParentNodeCannotBeNull => Error.Failure(description: nameof(ParentNodeCannotBeNull));
/// <summary>
/// Gets the error that reports that a file system operation failed because the path exceeds the maximum length of 260 characters.
/// </summary>
public static Error PathMustBeMaximum260CharactersLong => Error.Failure(description: nameof(PathMustBeMaximum260CharactersLong));
/// <summary>
/// Gets the error that reports that copying a file failed.
/// </summary>
public static Error FileCopyError => Error.Failure(description: nameof(FileCopyError));
/// <summary>
/// Gets the error that reports that moving a file failed.
/// </summary>
public static Error FileMoveError => Error.Failure(description: nameof(FileMoveError));
/// <summary>
/// Gets the error that reports that deleting a file failed.
/// </summary>
public static Error FileDeleteError => Error.Failure(description: nameof(FileDeleteError));
/// <summary>
/// Gets the error that reports that copying a directory failed.
/// </summary>
public static Error DirectoryCopyError => Error.Failure(description: nameof(DirectoryCopyError));
/// <summary>
/// Gets the error that reports that moving a directory failed.
/// </summary>
public static Error DirectoryMoveError => Error.Failure(description: nameof(DirectoryMoveError));
/// <summary>
/// Gets the error that reports that the requested file was not found.
/// </summary>
public static Error FileNotFound => Error.NotFound(description: nameof(FileNotFound));
/// <summary>
/// Gets the error that reports that the file system path is not valid.
/// </summary>
public static Error InvalidPath => Error.Validation(description: nameof(InvalidPath));
/// <summary>
/// Gets the error that reports that the file system path cannot be empty.
/// </summary>
public static Error PathCannotBeEmpty => Error.Validation(description: nameof(PathCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the file extension cannot be empty.
/// </summary>
public static Error ExtensionCannotBeEmpty => Error.Validation(description: nameof(ExtensionCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the stream identifier cannot be empty.
/// </summary>
public static Error StreamIdCannotBeEmpty => Error.Validation(description: nameof(StreamIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the codec name cannot be empty.
/// </summary>
public static Error CodecCannotBeEmpty => Error.Validation(description: nameof(CodecCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the bitrate must be a positive number.
/// </summary>
public static Error BitrateMustBeAPositiveNumber => Error.Validation(description: nameof(BitrateMustBeAPositiveNumber));
/// <summary>
/// Gets the error that reports that the file system browser cannot navigate above the root directory.
/// </summary>
public static Error CannotNavigateUp => Error.Failure(description: nameof(CannotNavigateUp));
/// <summary>
/// Gets the error that reports that the name of the file system node cannot be empty.
/// </summary>
public static Error NameCannotBeEmpty => Error.Validation(description: nameof(NameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the file name cannot be empty.
/// </summary>
public static Error FileNameCannotBeEmpty => Error.Validation(description: nameof(FileNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a file with the same name already exists in the target directory.
/// </summary>
public static Error FileAlreadyExists => Error.Conflict(description: nameof(FileAlreadyExists));
/// <summary>
/// Gets the error that reports that the requested directory was not found.
/// </summary>
public static Error DirectoryNotFound => Error.NotFound(description: nameof(DirectoryNotFound));
/// <summary>
/// Gets the error that reports that a directory with the same name already exists in the target location.
/// </summary>
public static Error DirectoryAlreadyExists => Error.Conflict(description: nameof(DirectoryAlreadyExists));
/// <summary>
/// Gets the error that reports that the file exceeds the maximum allowed size.
/// </summary>
public static Error FileTooLarge => Error.Validation(description: nameof(FileTooLarge));
}
}
@@ -9,27 +9,109 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report media library rule violations and missing libraries.
/// </summary>
public static class Library
{
/// <summary>
/// Gets the error that reports that a locked media library cannot be scanned.
/// </summary>
public static Error CannotScanLockedLibrary => Error.Forbidden(description: nameof(CannotScanLockedLibrary));
/// <summary>
/// Gets the error that reports that a disabled media library cannot be scanned.
/// </summary>
public static Error CannotScanDisabledLibrary => Error.Forbidden(description: nameof(CannotScanDisabledLibrary));
/// <summary>
/// Gets the error that reports that the library identifier cannot be empty.
/// </summary>
public static Error LibraryIdCannotBeEmpty => Error.Validation(description: nameof(LibraryIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a library-scoped filter must include a library identifier.
/// </summary>
public static Error FilterMustIncludeLibraryId => Error.Validation(description: nameof(FilterMustIncludeLibraryId));
/// <summary>
/// Gets the error that reports that the alphabetical filter key is not valid.
/// </summary>
public static Error InvalidFilterAlphaKey => Error.Validation(description: nameof(InvalidFilterAlphaKey));
/// <summary>
/// Gets the error that reports that a media library with the same identifier already exists.
/// </summary>
public static Error LibraryAlreadyExists => Error.Conflict(description: nameof(LibraryAlreadyExists));
/// <summary>
/// Gets the error that reports that the requested media library was not found.
/// </summary>
public static Error LibraryNotFound => Error.NotFound(description: nameof(LibraryNotFound));
/// <summary>
/// Gets the error that reports that the library type must not be <see langword="null"/>.
/// </summary>
public static Error LibraryTypeCannotBeNull => Error.Validation(description: nameof(LibraryTypeCannotBeNull));
/// <summary>
/// Gets the error that reports that the library cover file must be an image.
/// </summary>
public static Error CoverFileMustBeAnImage => Error.Validation(description: nameof(CoverFileMustBeAnImage));
/// <summary>
/// Gets the error that reports that the operation cannot be performed because the library type is not recognized.
/// </summary>
public static Error UnknownLibraryType => Error.Forbidden(description: nameof(UnknownLibraryType));
/// <summary>
/// Gets the error that reports that the list of library content paths must not be <see langword="null"/>.
/// </summary>
public static Error PathsListCannotBeNull => Error.Validation(description: nameof(PathsListCannotBeNull));
/// <summary>
/// Gets the error that reports that the list of library content paths cannot be empty.
/// </summary>
public static Error PathsListCannotBeEmpty => Error.Validation(description: nameof(PathsListCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the library title cannot be empty.
/// </summary>
public static Error TitleCannotBeEmpty => Error.Validation(description: nameof(TitleCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the library title exceeds the maximum length of 255 characters.
/// </summary>
public static Error TitleMustBeMaximum255CharactersLong => Error.Validation(description: nameof(TitleMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that a literal part of the path template cannot be empty.
/// </summary>
public static Error PathTemplateLiteralCannotBeEmpty => Error.Validation(description: nameof(PathTemplateLiteralCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a value part of the path template must contain exactly one placeholder.
/// </summary>
public static Error PathTemplateValuePartMustContainSinglePlaceholder => Error.Validation(description: nameof(PathTemplateValuePartMustContainSinglePlaceholder));
/// <summary>
/// Gets the error that reports that a path template part kind is not supported for the library type.
/// </summary>
public static Error PathTemplatePartKindNotSupportedForLibraryType => Error.Validation(description: nameof(PathTemplatePartKindNotSupportedForLibraryType));
/// <summary>
/// Gets the error that reports that path templates are not supported for the library type.
/// </summary>
public static Error PathTemplateIsNotSupportedForLibraryType => Error.Validation(description: nameof(PathTemplateIsNotSupportedForLibraryType));
/// <summary>
/// Gets the error that reports that the completion threshold percentage must be omitted when progress tracking is disabled.
/// </summary>
public static Error CompletionThresholdPercentageMustBeNullWhenProgressTrackingIsOff => Error.Validation(description: nameof(CompletionThresholdPercentageMustBeNullWhenProgressTrackingIsOff));
/// <summary>
/// Gets the error that reports that the completion threshold percentage must be between 0 and 100.
/// </summary>
public static Error CompletionThresholdPercentageMustBeBetweenZeroAndOneHundred => Error.Validation(description: nameof(CompletionThresholdPercentageMustBeBetweenZeroAndOneHundred));
}
}
@@ -9,24 +9,94 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report media library scan rule violations and missing scans.
/// </summary>
public static class LibraryScanning
{
/// <summary>
/// Gets the error that reports that the library scan identifier cannot be empty.
/// </summary>
public static Error LibraryScanIdCannotBeEmpty => Error.Validation(description: nameof(LibraryScanIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that only a pending scan can be started.
/// </summary>
public static Error CanOnlyStartPendingScans => Error.Forbidden(description: nameof(CanOnlyStartPendingScans));
/// <summary>
/// Gets the error that reports that only a running scan can be completed.
/// </summary>
public static Error CanOnlyCompleteRunningScans => Error.Forbidden(description: nameof(CanOnlyCompleteRunningScans));
/// <summary>
/// Gets the error that reports that only a pending or running scan can be cancelled.
/// </summary>
public static Error CanOnlyCancelPendingOrRunningScans => Error.Forbidden(description: nameof(CanOnlyCancelPendingOrRunningScans));
/// <summary>
/// Gets the error that reports that only a pending or running scan can be marked as failed.
/// </summary>
public static Error CanOnlyFailPendingOrRunningScans => Error.Forbidden(description: nameof(CanOnlyFailPendingOrRunningScans));
/// <summary>
/// Gets the error that reports that the scan identifier cannot be empty.
/// </summary>
public static Error ScanIdCannotBeEmpty => Error.Validation(description: nameof(ScanIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a media library scan with the same identifier already exists.
/// </summary>
public static Error LibraryScanAlreadyExists => Error.Conflict(description: nameof(LibraryScanAlreadyExists));
/// <summary>
/// Gets the error that reports that the library is already being scanned.
/// </summary>
public static Error LibraryAlreadyBeingScanned => Error.Forbidden(description: nameof(LibraryAlreadyBeingScanned));
/// <summary>
/// Gets the error that reports that the requested library scan was not found.
/// </summary>
public static Error LibraryScanNotFound => Error.NotFound(description: nameof(LibraryScanNotFound));
/// <summary>
/// Gets the error that reports that the total scan job items count cannot be negative.
/// </summary>
public static Error TotalScanJobItemsCountMustBePositive => Error.Validation(description: nameof(TotalScanJobItemsCountMustBePositive));
/// <summary>
/// Gets the error that reports that the total scan jobs count cannot be negative, and cannot be zero unless the scan is pending.
/// </summary>
public static Error TotalScanJobsCountMustBePositive => Error.Validation(description: nameof(TotalScanJobsCountMustBePositive));
/// <summary>
/// Gets the error that reports that the completed scan job items count cannot be negative.
/// </summary>
public static Error CompletedScanJobItemsCountMustBePositive => Error.Validation(description: nameof(CompletedScanJobItemsCountMustBePositive));
/// <summary>
/// Gets the error that reports that the completed scan jobs count cannot be negative.
/// </summary>
public static Error CompletedScanJobsCountMustBePositive => Error.Validation(description: nameof(CompletedScanJobsCountMustBePositive));
/// <summary>
/// Gets the error that reports that the completed scan job items count cannot exceed the total scan job items count.
/// </summary>
public static Error CompletedScanJobItemsCountCantExceedTotalScanJobItemsCount => Error.Validation(description: nameof(CompletedScanJobItemsCountCantExceedTotalScanJobItemsCount));
/// <summary>
/// Gets the error that reports that the completed scan jobs count cannot exceed the total scan jobs count.
/// </summary>
public static Error CompletedScanJobsCountCantExceedTotalScanJobsCount => Error.Validation(description: nameof(CompletedScanJobsCountCantExceedTotalScanJobsCount));
/// <summary>
/// Gets the error that reports that the current operation of a scan job cannot be empty.
/// </summary>
public static Error ScanJobCurrentOperationCannotBeEmpty => Error.Validation(description: nameof(ScanJobCurrentOperationCannotBeEmpty));
/// <summary>
/// Gets the error that reports that no scanner is implemented for the requested library type.
/// </summary>
public static Error NoScannerForLibraryType => Error.NotImplemented(description: nameof(NoScannerForLibraryType));
}
}
@@ -9,29 +9,119 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report media consumption rule violations and missing consumption records.
/// </summary>
public static class MediaConsumption
{
/// <summary>
/// Gets the error that reports that the media kind does not support consumption tracking.
/// </summary>
public static Error UnsupportedMediaKind => Error.Validation(description: nameof(UnsupportedMediaKind));
/// <summary>
/// Gets the error that reports that the media kind cannot start in a completed state because it is not a one-shot kind.
/// </summary>
public static Error MediaKindCannotStartCompleted => Error.Forbidden(description: nameof(MediaKindCannotStartCompleted));
/// <summary>
/// Gets the error that reports that a consumption of the media kind cannot be resumed.
/// </summary>
public static Error MediaKindCannotResume => Error.Forbidden(description: nameof(MediaKindCannotResume));
/// <summary>
/// Gets the error that reports that the requested consumption record was not found.
/// </summary>
public static Error ConsumptionRecordNotFound => Error.NotFound(description: nameof(ConsumptionRecordNotFound));
/// <summary>
/// Gets the error that reports that the resume point of the media item was not found.
/// </summary>
public static Error MediaResumePointNotFound => Error.NotFound(description: nameof(MediaResumePointNotFound));
/// <summary>
/// Gets the error that reports that the consumption record identifier cannot be empty.
/// </summary>
public static Error ConsumptionRecordIdCannotBeEmpty => Error.Validation(description: nameof(ConsumptionRecordIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the media item identifier cannot be empty.
/// </summary>
public static Error MediaItemIdCannotBeEmpty => Error.Validation(description: nameof(MediaItemIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the target user identifier is not valid.
/// </summary>
public static Error TargetUserIdIsInvalid => Error.Validation(description: nameof(TargetUserIdIsInvalid));
/// <summary>
/// Gets the error that reports that the consumption date range is not valid.
/// </summary>
public static Error ConsumptionDateRangeIsInvalid => Error.Validation(description: nameof(ConsumptionDateRangeIsInvalid));
/// <summary>
/// Gets the error that reports that the media position is not valid.
/// </summary>
public static Error InvalidMediaPosition => Error.Validation(description: nameof(InvalidMediaPosition));
/// <summary>
/// Gets the error that reports that the progress fraction is not valid.
/// </summary>
public static Error InvalidProgressFraction => Error.Validation(description: nameof(InvalidProgressFraction));
/// <summary>
/// Gets the error that reports that the consumed duration cannot be negative.
/// </summary>
public static Error ConsumedDurationMustBeNonNegative => Error.Validation(description: nameof(ConsumedDurationMustBeNonNegative));
/// <summary>
/// Gets the error that reports that the consumed duration is outside the allowed range.
/// </summary>
public static Error ConsumedDurationIsOutOfRange => Error.Validation(description: nameof(ConsumedDurationIsOutOfRange));
/// <summary>
/// Gets the error that reports that the consumed duration cannot decrease.
/// </summary>
public static Error ConsumedDurationCannotDecrease => Error.Forbidden(description: nameof(ConsumedDurationCannotDecrease));
/// <summary>
/// Gets the error that reports that the consecutive pages read count cannot be negative.
/// </summary>
public static Error ConsecutivePagesReadMustBeNonNegative => Error.Validation(description: nameof(ConsecutivePagesReadMustBeNonNegative));
/// <summary>
/// Gets the error that reports that consecutive pages read is only supported for page-based media.
/// </summary>
public static Error ConsecutivePagesReadIsOnlySupportedForPageBasedMedia => Error.Forbidden(description: nameof(ConsecutivePagesReadIsOnlySupportedForPageBasedMedia));
/// <summary>
/// Gets the error that reports that the consumption is not in progress.
/// </summary>
public static Error ConsumptionIsNotInProgress => Error.Conflict(description: nameof(ConsumptionIsNotInProgress));
/// <summary>
/// Gets the error that reports that the consumption already reached a terminal state.
/// </summary>
public static Error ConsumptionIsAlreadyTerminal => Error.Conflict(description: nameof(ConsumptionIsAlreadyTerminal));
/// <summary>
/// Gets the error that reports that a consumption in progress cannot have an end time.
/// </summary>
public static Error InProgressConsumptionCannotHaveEndTime => Error.Validation(description: nameof(InProgressConsumptionCannotHaveEndTime));
/// <summary>
/// Gets the error that reports that an ended consumption must have an end time.
/// </summary>
public static Error EndedConsumptionMustHaveEndTime => Error.Validation(description: nameof(EndedConsumptionMustHaveEndTime));
/// <summary>
/// Gets the error that reports that the last activity of a consumption cannot precede its start.
/// </summary>
public static Error LastActivityCannotPrecedeStart => Error.Forbidden(description: nameof(LastActivityCannotPrecedeStart));
/// <summary>
/// Gets the error that reports that the end of a consumption cannot precede its last activity.
/// </summary>
public static Error EndedConsumptionCannotPrecedeLastActivity => Error.Forbidden(description: nameof(EndedConsumptionCannotPrecedeLastActivity));
}
}
@@ -9,20 +9,74 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report media contributor rule violations and missing contributors.
/// </summary>
public static class MediaContributor
{
/// <summary>
/// Gets the error that reports that the contributor name cannot be empty.
/// </summary>
public static Error ContributorNameCannotBeEmpty => Error.Validation(description: nameof(ContributorNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the contributor display name cannot be empty.
/// </summary>
public static Error ContributorDisplayNameCannotBeEmpty => Error.Validation(description: nameof(ContributorDisplayNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the contributor display name exceeds the maximum length of 100 characters.
/// </summary>
public static Error ContributorDisplayNameMustBeMaximum100CharactersLong => Error.Validation(description: nameof(ContributorDisplayNameMustBeMaximum100CharactersLong));
/// <summary>
/// Gets the error that reports that the contributor legal name exceeds the maximum length of 100 characters.
/// </summary>
public static Error ContributorLegalNameMustBeMaximum100CharactersLong => Error.Validation(description: nameof(ContributorLegalNameMustBeMaximum100CharactersLong));
/// <summary>
/// Gets the error that reports that the contributor role name cannot be empty.
/// </summary>
public static Error RoleNameCannotBeEmpty => Error.Validation(description: nameof(RoleNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the contributor role name exceeds the maximum length of 50 characters.
/// </summary>
public static Error RoleNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(RoleNameMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the contributor role category cannot be empty.
/// </summary>
public static Error RoleCategoryCannotBeEmpty => Error.Validation(description: nameof(RoleCategoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the contributor role must not be <see langword="null"/>.
/// </summary>
public static Error ContributorRoleCannotBeNull => Error.Validation(description: nameof(ContributorRoleCannotBeNull));
/// <summary>
/// Gets the error that reports that the contributors list must not be <see langword="null"/>.
/// </summary>
public static Error ContributorsListCannotBeNull => Error.Validation(description: nameof(ContributorsListCannotBeNull));
/// <summary>
/// Gets the error that reports that the media contributor identifier cannot be empty.
/// </summary>
public static Error MediaContributorIdCannotBeEmpty => Error.Validation(description: nameof(MediaContributorIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the requested media contributor was not found.
/// </summary>
public static Error MediaContributorNotFound => Error.NotFound(description: nameof(MediaContributorNotFound));
/// <summary>
/// Gets the error that reports that the media contributor already exists.
/// </summary>
public static Error MediaContributorAlreadyExists => Error.Conflict(description: nameof(MediaContributorAlreadyExists));
/// <summary>
/// Gets the error that reports that the media contributor role is not a defined value.
/// </summary>
public static Error UnknownMediaContributorRole => Error.Validation(description: nameof(UnknownMediaContributorRole));
}
}
@@ -9,9 +9,19 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report media item contributor name rule violations.
/// </summary>
public static class MediaContributors
{
/// <summary>
/// Gets the error that reports that the name of a media contributor cannot be empty.
/// </summary>
public static Error MediaContributorNameCannotBeEmpty => Error.Validation(description: nameof(MediaContributorNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the role name of a media contributor cannot be empty.
/// </summary>
public static Error MediaContributorRoleNameCannotBeEmpty => Error.Validation(description: nameof(MediaContributorRoleNameCannotBeEmpty));
}
}
@@ -9,38 +9,164 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Defines the errors that report failures raised while working with the metadata of media items.
/// </summary>
public static class Metadata
{
/// <summary>
/// Gets the error that reports that the metadata of a media item cannot be <see langword="null"/>.
/// </summary>
public static Error MetadataCannotBeNull => Error.Validation(description: nameof(MetadataCannotBeNull));
/// <summary>
/// Gets the error that reports that the title of a media item cannot be empty.
/// </summary>
public static Error TitleCannotBeEmpty => Error.Validation(description: nameof(TitleCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the title of a media item exceeds the maximum length of 255 characters.
/// </summary>
public static Error TitleMustBeMaximum255CharactersLong => Error.Validation(description: nameof(TitleMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the original title of a media item exceeds the maximum length of 255 characters.
/// </summary>
public static Error OriginalTitleMustBeMaximum255CharactersLong => Error.Validation(description: nameof(OriginalTitleMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the description of a media item exceeds the maximum length of 2000 characters.
/// </summary>
public static Error DescriptionMustBeMaximum2000CharactersLong => Error.Validation(description: nameof(DescriptionMustBeMaximum2000CharactersLong));
/// <summary>
/// Gets the error that reports that the collection of genres for a media item cannot be <see langword="null"/>.
/// </summary>
public static Error GenresListCannotBeNull => Error.Validation(description: nameof(GenresListCannotBeNull));
/// <summary>
/// Gets the error that reports that the name of a genre cannot be empty.
/// </summary>
public static Error GenreNameCannotBeEmpty => Error.Validation(description: nameof(GenreNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the name of a genre exceeds the maximum length of 50 characters.
/// </summary>
public static Error GenreNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(GenreNameMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the collection of tags for a media item cannot be <see langword="null"/>.
/// </summary>
public static Error TagsListCannotBeNull => Error.Validation(description: nameof(TagsListCannotBeNull));
/// <summary>
/// Gets the error that reports that the name of a tag cannot be empty.
/// </summary>
public static Error TagNameCannotBeEmpty => Error.Validation(description: nameof(TagNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the name of a tag exceeds the maximum length of 50 characters.
/// </summary>
public static Error TagNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(TagNameMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the name of a mood cannot be empty.
/// </summary>
public static Error MoodNameCannotBeEmpty => Error.Validation(description: nameof(MoodNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the code of a language cannot be empty.
/// </summary>
public static Error LanguageCodeCannotBeEmpty => Error.Validation(description: nameof(LanguageCodeCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the name of a language cannot be empty.
/// </summary>
public static Error LanguageNameCannotBeEmpty => Error.Validation(description: nameof(LanguageNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the code of a language must be exactly 2 characters long.
/// </summary>
public static Error LanguageCodeMustBe2CharactersLong => Error.Validation(description: nameof(LanguageCodeMustBe2CharactersLong));
/// <summary>
/// Gets the error that reports that the name of a language exceeds the maximum length of 50 characters.
/// </summary>
public static Error LanguageNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(LanguageNameMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the native name of a language exceeds the maximum length of 50 characters.
/// </summary>
public static Error LanguageNativeNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(LanguageNativeNameMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the original release year of a media item is outside the range from 1 to 9999.
/// </summary>
public static Error OriginalReleaseYearMustBeBetween1And9999 => Error.Validation(description: nameof(OriginalReleaseYearMustBeBetween1And9999));
/// <summary>
/// Gets the error that reports that the re-release year of a media item is outside the range from 1 to 9999.
/// </summary>
public static Error ReReleaseYearMustBeBetween1And9999 => Error.Validation(description: nameof(ReReleaseYearMustBeBetween1And9999));
/// <summary>
/// Gets the error that reports that the re-release year of a media item is earlier than its original release year.
/// </summary>
public static Error ReReleaseYearCannotBeEarlierThanOriginalReleaseYear => Error.Validation(description: nameof(ReReleaseYearCannotBeEarlierThanOriginalReleaseYear));
/// <summary>
/// Gets the error that reports that the code of a release country must be exactly 2 characters long.
/// </summary>
public static Error CountryCodeMustBe2CharactersLong => Error.Validation(description: nameof(CountryCodeMustBe2CharactersLong));
/// <summary>
/// Gets the error that reports that the release version of a media item exceeds the maximum length of 50 characters.
/// </summary>
public static Error ReleaseVersionMustBeMaximum50CharactersLong => Error.Validation(description: nameof(ReleaseVersionMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the original release date and the original release year of a media item refer to different years.
/// </summary>
public static Error OriginalReleaseDateAndYearMustMatch => Error.Validation(description: nameof(OriginalReleaseDateAndYearMustMatch));
/// <summary>
/// Gets the error that reports that the re-release date and the re-release year of a media item refer to different years.
/// </summary>
public static Error ReReleaseDateAndYearMustMatch => Error.Validation(description: nameof(ReReleaseDateAndYearMustMatch));
/// <summary>
/// Gets the error that reports that the re-release date of a media item is earlier than its original release date.
/// </summary>
public static Error ReReleaseDateCannotBeEarlierThanOriginalReleaseDate => Error.Validation(description: nameof(ReReleaseDateCannotBeEarlierThanOriginalReleaseDate));
/// <summary>
/// Gets the error that reports that the release information of a media item cannot be <see langword="null"/>.
/// </summary>
public static Error ReleaseInfoCannotBeNull => Error.Validation(description: nameof(ReleaseInfoCannotBeNull));
/// <summary>
/// Gets the error that reports that the value or the maximum value of a rating is negative.
/// </summary>
public static Error RatingValueMustBePositive => Error.Validation(description: nameof(RatingValueMustBePositive));
/// <summary>
/// Gets the error that reports that the maximum value of a rating must be positive.
/// </summary>
public static Error RatingMaxValueMustBePositive => Error.Validation(description: nameof(RatingMaxValueMustBePositive));
/// <summary>
/// Gets the error that reports that the value of a rating is greater than the maximum value of the same rating.
/// </summary>
public static Error RatingValueCannotBeGreaterThanMaxValue => Error.Validation(description: nameof(RatingValueCannotBeGreaterThanMaxValue));
/// <summary>
/// Gets the error that reports that the vote count of a rating must be positive.
/// </summary>
public static Error RatingVoteCountMustBePositive => Error.Validation(description: nameof(RatingVoteCountMustBePositive));
/// <summary>
/// Gets the error that reports that the collection of ratings for a media item cannot be <see langword="null"/>.
/// </summary>
public static Error RatingsListCannotBeNull => Error.Validation(description: nameof(RatingsListCannotBeNull));
}
}
@@ -9,65 +9,299 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Defines the errors that report failures raised while working with music artists, albums and tracks.
/// </summary>
public static class Music
{
/// <summary>
/// Gets the error that reports that the requested music artist does not exist.
/// </summary>
public static Error ArtistNotFound => Error.NotFound(description: nameof(ArtistNotFound));
/// <summary>
/// Gets the error that reports that a music artist with the same identifier or name already exists in the library.
/// </summary>
public static Error ArtistAlreadyExists => Error.Conflict(description: nameof(ArtistAlreadyExists));
/// <summary>
/// Gets the error that reports that a music artist identifier cannot be empty.
/// </summary>
public static Error ArtistIdCannotBeEmpty => Error.Validation(description: nameof(ArtistIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a music artist name cannot be empty.
/// </summary>
public static Error ArtistNameCannotBeEmpty => Error.Validation(description: nameof(ArtistNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a music artist name exceeds the maximum length of 255 characters.
/// </summary>
public static Error ArtistNameMustBeMaximum255CharactersLong => Error.Validation(description: nameof(ArtistNameMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that a music artist website exceeds the maximum length of 2048 characters.
/// </summary>
public static Error ArtistWebsiteMustBeMaximum2048CharactersLong => Error.Validation(description: nameof(ArtistWebsiteMustBeMaximum2048CharactersLong));
/// <summary>
/// Gets the error that reports that a MusicBrainz identifier does not have a valid format.
/// </summary>
public static Error MusicBrainzIdInvalidFormat => Error.Validation(description: nameof(MusicBrainzIdInvalidFormat));
/// <summary>
/// Gets the error that reports that an ISRC value cannot be empty.
/// </summary>
public static Error IsrcValueCannotBeEmpty => Error.Validation(description: nameof(IsrcValueCannotBeEmpty));
/// <summary>
/// Gets the error that reports that an ISRC value does not have a valid ISRC format.
/// </summary>
public static Error IsrcInvalidFormat => Error.Validation(description: nameof(IsrcInvalidFormat));
/// <summary>
/// Gets the error that reports that a barcode value cannot be empty.
/// </summary>
public static Error BarcodeValueCannotBeEmpty => Error.Validation(description: nameof(BarcodeValueCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a barcode is not made of 12 or 13 digits.
/// </summary>
public static Error InvalidFormatForBarcode => Error.Validation(description: nameof(InvalidFormatForBarcode));
/// <summary>
/// Gets the error that reports that the requested music album does not exist.
/// </summary>
public static Error AlbumNotFound => Error.NotFound(description: nameof(AlbumNotFound));
/// <summary>
/// Gets the error that reports that a music album with the same identifier already exists in the library.
/// </summary>
public static Error AlbumAlreadyExists => Error.Conflict(description: nameof(AlbumAlreadyExists));
/// <summary>
/// Gets the error that reports that a music artist cannot exist without at least one album.
/// </summary>
public static Error ArtistMustHaveAtLeastOneAlbum => Error.Forbidden(description: nameof(ArtistMustHaveAtLeastOneAlbum));
/// <summary>
/// Gets the error that reports that a music album identifier cannot be empty.
/// </summary>
public static Error AlbumIdCannotBeEmpty => Error.Validation(description: nameof(AlbumIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the collection of albums for a music artist cannot be <see langword="null"/>.
/// </summary>
public static Error AlbumsListCannotBeNull => Error.Validation(description: nameof(AlbumsListCannotBeNull));
/// <summary>
/// Gets the error that reports that a music album title cannot be empty.
/// </summary>
public static Error AlbumTitleCannotBeEmpty => Error.Validation(description: nameof(AlbumTitleCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a music album title exceeds the maximum length of 255 characters.
/// </summary>
public static Error AlbumTitleMustBeMaximum255CharactersLong => Error.Validation(description: nameof(AlbumTitleMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the total number of discs in a music album must be greater than zero.
/// </summary>
public static Error TotalDiscsMustBeGreaterThanZero => Error.Validation(description: nameof(TotalDiscsMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the total number of tracks in a music album must be greater than zero.
/// </summary>
public static Error TotalTracksMustBeGreaterThanZero => Error.Validation(description: nameof(TotalTracksMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that a music release type is not a recognized value.
/// </summary>
public static Error UnknownMusicReleaseType => Error.Validation(description: nameof(UnknownMusicReleaseType));
/// <summary>
/// Gets the error that reports that a music release status is not a recognized value.
/// </summary>
public static Error UnknownMusicReleaseStatus => Error.Validation(description: nameof(UnknownMusicReleaseStatus));
/// <summary>
/// Gets the error that reports that a music media format is not a recognized value.
/// </summary>
public static Error UnknownMusicMediaFormat => Error.Validation(description: nameof(UnknownMusicMediaFormat));
/// <summary>
/// Gets the error that reports that a music release packaging is not a recognized value.
/// </summary>
public static Error UnknownMusicReleasePackaging => Error.Validation(description: nameof(UnknownMusicReleasePackaging));
/// <summary>
/// Gets the error that reports that a music key is not a recognized value.
/// </summary>
public static Error UnknownMusicKey => Error.Validation(description: nameof(UnknownMusicKey));
/// <summary>
/// Gets the error that reports that a music album catalog number exceeds the maximum length of 50 characters.
/// </summary>
public static Error CatalogNumberMustBeMaximum50CharactersLong => Error.Validation(description: nameof(CatalogNumberMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the requested music track does not exist.
/// </summary>
public static Error TrackNotFound => Error.NotFound(description: nameof(TrackNotFound));
/// <summary>
/// Gets the error that reports that the audio file of a music track does not exist or cannot be read.
/// </summary>
public static Error TrackFileNotFound => Error.NotFound(description: nameof(TrackFileNotFound));
/// <summary>
/// Gets the error that reports that a music track with the same identifier or file path already exists in the library.
/// </summary>
public static Error TrackAlreadyExists => Error.Conflict(description: nameof(TrackAlreadyExists));
/// <summary>
/// Gets the error that reports that a music track identifier cannot be empty.
/// </summary>
public static Error TrackIdCannotBeEmpty => Error.Validation(description: nameof(TrackIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the collection of tracks for a music album cannot be <see langword="null"/>.
/// </summary>
public static Error TracksListCannotBeNull => Error.Validation(description: nameof(TracksListCannotBeNull));
/// <summary>
/// Gets the error that reports that a music track file path cannot be empty.
/// </summary>
public static Error TrackPathCannotBeEmpty => Error.Validation(description: nameof(TrackPathCannotBeEmpty));
/// <summary>
/// Gets the error that reports that a music track file path exceeds the maximum length of 2048 characters.
/// </summary>
public static Error TrackPathMustBeMaximum2048CharactersLong => Error.Validation(description: nameof(TrackPathMustBeMaximum2048CharactersLong));
/// <summary>
/// Gets the error that reports that a music track file path does not reside within any of the content locations of the library.
/// </summary>
public static Error TrackPathMustBeWithinLibraryContentLocations => Error.Validation(description: nameof(TrackPathMustBeWithinLibraryContentLocations));
/// <summary>
/// Gets the error that reports that the number of a music track must be greater than zero.
/// </summary>
public static Error TrackNumberMustBeGreaterThanZero => Error.Validation(description: nameof(TrackNumberMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the disc number of a music track must be greater than zero.
/// </summary>
public static Error DiscNumberMustBeGreaterThanZero => Error.Validation(description: nameof(DiscNumberMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that a music script exceeds the maximum length of 50 characters.
/// </summary>
public static Error ScriptMustBeMaximum50CharactersLong => Error.Validation(description: nameof(ScriptMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the title of a music work exceeds the maximum length of 255 characters.
/// </summary>
public static Error WorkMustBeMaximum255CharactersLong => Error.Validation(description: nameof(WorkMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the beats per minute value of a music track must be greater than zero.
/// </summary>
public static Error BpmMustBeGreaterThanZero => Error.Validation(description: nameof(BpmMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the album cannot be added to the music artist because the artist already has it.
/// </summary>
public static Error TheArtistAlreadyHasTheAlbum => Error.Forbidden(description: nameof(TheArtistAlreadyHasTheAlbum));
/// <summary>
/// Gets the error that reports that the album cannot be removed from the music artist because the artist does not have it.
/// </summary>
public static Error TheArtistDoesNotHaveTheAlbum => Error.Forbidden(description: nameof(TheArtistDoesNotHaveTheAlbum));
/// <summary>
/// Gets the error that reports that the track cannot be added to the music album because the album already contains it.
/// </summary>
public static Error TheTrackIsAlreadyInTheAlbum => Error.Forbidden(description: nameof(TheTrackIsAlreadyInTheAlbum));
/// <summary>
/// Gets the error that reports that the track cannot be removed from the music album because the album does not contain it.
/// </summary>
public static Error TheTrackIsNotInTheAlbum => Error.Forbidden(description: nameof(TheTrackIsNotInTheAlbum));
/// <summary>
/// Gets the error that reports that the name of a music area cannot be empty.
/// </summary>
public static Error AreaNameCannotBeEmpty => Error.Validation(description: nameof(AreaNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the name of a music artist alias cannot be empty.
/// </summary>
public static Error ArtistAliasNameCannotBeEmpty => Error.Validation(description: nameof(ArtistAliasNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the name of a music artist alias exceeds the maximum length of 255 characters.
/// </summary>
public static Error ArtistAliasNameMustBeMaximum255CharactersLong => Error.Validation(description: nameof(ArtistAliasNameMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the name of a music area exceeds the maximum length of 255 characters.
/// </summary>
public static Error AreaNameMustBeMaximum255CharactersLong => Error.Validation(description: nameof(AreaNameMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that a music artist type is not a recognized value.
/// </summary>
public static Error UnknownMusicArtistType => Error.Validation(description: nameof(UnknownMusicArtistType));
/// <summary>
/// Gets the error that reports that a music artist gender is not a recognized value.
/// </summary>
public static Error UnknownMusicArtistGender => Error.Validation(description: nameof(UnknownMusicArtistGender));
/// <summary>
/// Gets the error that reports that a music artist country exceeds the maximum length of 2 characters.
/// </summary>
public static Error CountryMustBeMaximum2CharactersLong => Error.Validation(description: nameof(CountryMustBeMaximum2CharactersLong));
/// <summary>
/// Gets the error that reports that an IPI value cannot be empty.
/// </summary>
public static Error IpiValueCannotBeEmpty => Error.Validation(description: nameof(IpiValueCannotBeEmpty));
/// <summary>
/// Gets the error that reports that an IPI value exceeds the maximum length of 20 characters.
/// </summary>
public static Error IpiValueMustBeMaximum20CharactersLong => Error.Validation(description: nameof(IpiValueMustBeMaximum20CharactersLong));
/// <summary>
/// Gets the error that reports that an ISNI value cannot be empty.
/// </summary>
public static Error IsniValueCannotBeEmpty => Error.Validation(description: nameof(IsniValueCannotBeEmpty));
/// <summary>
/// Gets the error that reports that an ISNI value exceeds the maximum length of 20 characters.
/// </summary>
public static Error IsniValueMustBeMaximum20CharactersLong => Error.Validation(description: nameof(IsniValueMustBeMaximum20CharactersLong));
/// <summary>
/// Gets the error that reports that the title of a music work cannot be empty.
/// </summary>
public static Error WorkTitleCannotBeEmpty => Error.Validation(description: nameof(WorkTitleCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the cover image of a music artist or album cannot be <see langword="null"/>.
/// </summary>
public static Error CoverCannotBeNull => Error.Validation(description: nameof(CoverCannotBeNull));
/// <summary>
/// Gets the error that reports that the number of tracks requested for shuffling must be greater than zero.
/// </summary>
public static Error ShuffleTrackCountMustBeGreaterThanZero => Error.Validation(description: nameof(ShuffleTrackCountMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the number of tracks requested for shuffling cannot exceed 500.
/// </summary>
public static Error ShuffleTrackCountMustBeAtMost500 => Error.Validation(description: nameof(ShuffleTrackCountMustBeAtMost500));
}
}
@@ -9,8 +9,14 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report denied access to file system resources.
/// </summary>
public static class Permission
{
/// <summary>
/// Gets the error that reports that the current user is not authorized to access the requested resource.
/// </summary>
public static Error UnauthorizedAccess => Error.Failure(description: nameof(UnauthorizedAccess));
}
}
@@ -9,24 +9,94 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report playback delivery and track normalization failures.
/// </summary>
public static class Playback
{
/// <summary>
/// Gets the error that reports that no supported playback format is available for the requested track.
/// </summary>
public static Error NoSupportedPlaybackFormat => Error.Forbidden(description: nameof(NoSupportedPlaybackFormat));
/// <summary>
/// Gets the error that reports that the playback delivery changed before it could be used.
/// </summary>
public static Error PlaybackDeliveryChanged => Error.Conflict(description: nameof(PlaybackDeliveryChanged));
/// <summary>
/// Gets the error that reports that the requested playback delivery was not found.
/// </summary>
public static Error PlaybackDeliveryNotFound => Error.NotFound(description: nameof(PlaybackDeliveryNotFound));
/// <summary>
/// Gets the error that reports that the playback delivery identifier cannot be empty.
/// </summary>
public static Error DeliveryIdCannotBeEmpty => Error.Validation(description: nameof(DeliveryIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the playback delivery identifier is not valid.
/// </summary>
public static Error DeliveryIdIsInvalid => Error.Validation(description: nameof(DeliveryIdIsInvalid));
/// <summary>
/// Gets the error that reports that the playback format has no implementation.
/// </summary>
public static Error PlaybackFormatNotImplemented => Error.Internal(description: nameof(PlaybackFormatNotImplemented));
/// <summary>
/// Gets the error that reports that the normalized track cache entry was not found.
/// </summary>
public static Error NormalizedTrackCacheEntryNotFound => Error.NotFound(description: nameof(NormalizedTrackCacheEntryNotFound));
/// <summary>
/// Gets the error that reports that the normalized track segment was not found.
/// </summary>
public static Error NormalizedTrackSegmentNotFound => Error.NotFound(description: nameof(NormalizedTrackSegmentNotFound));
/// <summary>
/// Gets the error that reports that the track normalization failed.
/// </summary>
public static Error NormalizationFailed => Error.Failure(description: nameof(NormalizationFailed));
/// <summary>
/// Gets the error that reports that the normalized track cache limit was exceeded.
/// </summary>
public static Error NormalizationCacheLimitExceeded => Error.Failure(description: nameof(NormalizationCacheLimitExceeded));
/// <summary>
/// Gets the error that reports that the track normalization timed out.
/// </summary>
public static Error NormalizationTimedOut => Error.Timeout(description: nameof(NormalizationTimedOut));
/// <summary>
/// Gets the error that reports that the track normalization is unavailable because a required resource cannot be used.
/// </summary>
public static Error NormalizationUnavailable => Error.ResourceUnavailable(description: nameof(NormalizationUnavailable));
/// <summary>
/// Gets the error that reports that normalization is not required for a directly played track.
/// </summary>
public static Error NormalizationIsNotRequiredForDirectPlay => Error.Conflict(description: nameof(NormalizationIsNotRequiredForDirectPlay));
/// <summary>
/// Gets the error that reports that the segment duration must be a positive number.
/// </summary>
public static Error SegmentDurationMustBePositive => Error.Validation(description: nameof(SegmentDurationMustBePositive));
/// <summary>
/// Gets the error that reports that the segment index cannot be empty.
/// </summary>
public static Error SegmentIndexCannotBeEmpty => Error.Validation(description: nameof(SegmentIndexCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the segment index is not valid.
/// </summary>
public static Error SegmentIndexMustBeValid => Error.Validation(description: nameof(SegmentIndexMustBeValid));
/// <summary>
/// Gets the error that reports that the track duration must be a positive number.
/// </summary>
public static Error TrackDurationMustBePositive => Error.Validation(description: nameof(TrackDurationMustBePositive));
}
}
@@ -9,19 +9,69 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report playlist rule violations and missing playlists.
/// </summary>
public static class Playlists
{
/// <summary>
/// Gets the error that reports that the requested playlist was not found.
/// </summary>
public static Error PlaylistNotFound => Error.NotFound(description: nameof(PlaylistNotFound));
/// <summary>
/// Gets the error that reports that a playlist with the same identifier already exists.
/// </summary>
public static Error PlaylistAlreadyExists => Error.Conflict(description: nameof(PlaylistAlreadyExists));
/// <summary>
/// Gets the error that reports that the playlist identifier cannot be empty.
/// </summary>
public static Error PlaylistIdCannotBeEmpty => Error.Validation(description: nameof(PlaylistIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the playlist entry identifier cannot be empty.
/// </summary>
public static Error PlaylistEntryIdCannotBeEmpty => Error.Validation(description: nameof(PlaylistEntryIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the playlist name cannot be empty.
/// </summary>
public static Error PlaylistNameCannotBeEmpty => Error.Validation(description: nameof(PlaylistNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the playlist name exceeds the maximum length of 255 characters.
/// </summary>
public static Error PlaylistNameMustBeMaximum255CharactersLong => Error.Validation(description: nameof(PlaylistNameMustBeMaximum255CharactersLong));
/// <summary>
/// Gets the error that reports that the playlist description exceeds the maximum length of 2000 characters.
/// </summary>
public static Error PlaylistDescriptionMustBeMaximum2000CharactersLong => Error.Validation(description: nameof(PlaylistDescriptionMustBeMaximum2000CharactersLong));
/// <summary>
/// Gets the error that reports that the playlist type is not a defined value.
/// </summary>
public static Error PlaylistTypeIsInvalid => Error.Validation(description: nameof(PlaylistTypeIsInvalid));
/// <summary>
/// Gets the error that reports that the playlist type does not accept media items.
/// </summary>
public static Error PlaylistDoesNotAcceptMediaItems => Error.Forbidden(description: nameof(PlaylistDoesNotAcceptMediaItems));
/// <summary>
/// Gets the error that reports that the requested playlist entry was not found.
/// </summary>
public static Error PlaylistEntryNotFound => Error.NotFound(description: nameof(PlaylistEntryNotFound));
/// <summary>
/// Gets the error that reports that the positions of the playlist entries are not valid.
/// </summary>
public static Error PlaylistEntryPositionsAreInvalid => Error.Validation(description: nameof(PlaylistEntryPositionsAreInvalid));
/// <summary>
/// Gets the error that reports that the target position of the playlist entry move is not valid.
/// </summary>
public static Error PlaylistMoveTargetPositionIsInvalid => Error.Validation(description: nameof(PlaylistMoveTargetPositionIsInvalid));
}
}
@@ -9,19 +9,69 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report plugin rule violations and plugin loading failures.
/// </summary>
public static class Plugins
{
/// <summary>
/// Gets the error that reports that the requested plugin was not found.
/// </summary>
public static Error PluginNotFound => Error.NotFound(description: nameof(PluginNotFound));
/// <summary>
/// Gets the error that reports that the plugin identifier cannot be empty.
/// </summary>
public static Error PluginIdCannotBeEmpty => Error.Validation(description: nameof(PluginIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the plugin settings must not be <see langword="null"/>.
/// </summary>
public static Error PluginSettingsCannotBeNull => Error.Validation(description: nameof(PluginSettingsCannotBeNull));
/// <summary>
/// Gets the error that reports that the library identifier cannot be empty.
/// </summary>
public static Error LibraryIdCannotBeEmpty => Error.Validation(description: nameof(LibraryIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the plugin identifiers must be unique.
/// </summary>
public static Error PluginIdsMustBeUnique => Error.Validation(description: nameof(PluginIdsMustBeUnique));
/// <summary>
/// Gets the error that reports that the plugin is not supported for the library type.
/// </summary>
public static Error PluginNotSupportedForLibraryType => Error.Validation(description: nameof(PluginNotSupportedForLibraryType));
/// <summary>
/// Gets the error that reports that the metadata provider configuration of the library was not found.
/// </summary>
public static Error LibraryMetadataProviderConfigurationNotFound => Error.NotFound(description: nameof(LibraryMetadataProviderConfigurationNotFound));
/// <summary>
/// Gets the error that reports that the plugin archive must not be <see langword="null"/>.
/// </summary>
public static Error PluginArchiveCannotBeNull => Error.Validation(description: nameof(PluginArchiveCannotBeNull));
/// <summary>
/// Gets the error that reports that the plugin file name cannot be empty.
/// </summary>
public static Error PluginFileNameCannotBeEmpty => Error.Validation(description: nameof(PluginFileNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the plugin file type is not supported.
/// </summary>
public static Error UnsupportedPluginFileType => Error.Validation(description: nameof(UnsupportedPluginFileType));
/// <summary>
/// Gets the error that reports that the plugin archive could not be read.
/// </summary>
public static Error PluginArchiveNotReadable => Error.Failure(description: nameof(PluginArchiveNotReadable));
/// <summary>
/// Gets the error that reports that the plugin archive contains no assemblies.
/// </summary>
public static Error PluginArchiveContainsNoAssemblies => Error.Failure(description: nameof(PluginArchiveContainsNoAssemblies));
}
}
@@ -9,15 +9,49 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report reading rule violations and missing reading resources.
/// </summary>
public static class Reading
{
/// <summary>
/// Gets the error that reports that the reading location reference cannot be empty.
/// </summary>
public static Error LocationRefCannotBeEmpty => Error.Validation(description: nameof(LocationRefCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the reading resource key cannot be empty.
/// </summary>
public static Error ResourceKeyCannotBeEmpty => Error.Validation(description: nameof(ResourceKeyCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the requested book was not found.
/// </summary>
public static Error BookNotFound => Error.NotFound(description: nameof(BookNotFound));
/// <summary>
/// Gets the error that reports that no book reader is available.
/// </summary>
public static Error NoReaderAvailable => Error.NotFound(description: nameof(NoReaderAvailable));
/// <summary>
/// Gets the error that reports that the requested book reader was not found because it is disabled.
/// </summary>
public static Error ReaderDisabled => Error.NotFound(description: nameof(ReaderDisabled));
/// <summary>
/// Gets the error that reports that the file of the requested book was not found.
/// </summary>
public static Error BookFileNotFound => Error.NotFound(description: nameof(BookFileNotFound));
/// <summary>
/// Gets the error that reports that the requested book section was not found.
/// </summary>
public static Error SectionNotFound => Error.NotFound(description: nameof(SectionNotFound));
/// <summary>
/// Gets the error that reports that the requested reading resource was not found.
/// </summary>
public static Error ResourceNotFound => Error.NotFound(description: nameof(ResourceNotFound));
}
}
@@ -9,21 +9,79 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report scheduled job rule violations and scheduling conflicts.
/// </summary>
public static class Scheduling
{
/// <summary>
/// Gets the error that reports that the scheduled job name cannot be empty.
/// </summary>
public static Error ScheduledJobNameCannotBeEmpty => Error.Validation(description: nameof(ScheduledJobNameCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the interval in minutes must be a positive number.
/// </summary>
public static Error IntervalMinutesMustBePositive => Error.Validation(description: nameof(IntervalMinutesMustBePositive));
/// <summary>
/// Gets the error that reports that the hour must be between 0 and 23.
/// </summary>
public static Error HourMustBeBetweenZeroAndTwentyThree => Error.Validation(description: nameof(HourMustBeBetweenZeroAndTwentyThree));
/// <summary>
/// Gets the error that reports that the minute must be between 0 and 59.
/// </summary>
public static Error MinuteMustBeBetweenZeroAndFiftyNine => Error.Validation(description: nameof(MinuteMustBeBetweenZeroAndFiftyNine));
/// <summary>
/// Gets the error that reports that the scheduled job already exists.
/// </summary>
public static Error ScheduledJobAlreadyExists => Error.Conflict(description: nameof(ScheduledJobAlreadyExists));
/// <summary>
/// Gets the error that reports that the requested scheduled job was not found.
/// </summary>
public static Error ScheduledJobNotFound => Error.NotFound(description: nameof(ScheduledJobNotFound));
/// <summary>
/// Gets the error that reports that the scheduled job execution already exists.
/// </summary>
public static Error ScheduledJobExecutionAlreadyExists => Error.Conflict(description: nameof(ScheduledJobExecutionAlreadyExists));
/// <summary>
/// Gets the error that reports that the requested scheduled job execution was not found.
/// </summary>
public static Error ScheduledJobExecutionNotFound => Error.NotFound(description: nameof(ScheduledJobExecutionNotFound));
/// <summary>
/// Gets the error that reports that the cycle of the scheduled job was already started.
/// </summary>
public static Error ScheduledJobCycleAlreadyStarted => Error.Forbidden(description: nameof(ScheduledJobCycleAlreadyStarted));
/// <summary>
/// Gets the error that reports that the cycle of the scheduled job was not started.
/// </summary>
public static Error ScheduledJobNotStarted => Error.Forbidden(description: nameof(ScheduledJobNotStarted));
/// <summary>
/// Gets the error that reports that the scheduled job is already running.
/// </summary>
public static Error ScheduledJobAlreadyRunning => Error.Forbidden(description: nameof(ScheduledJobAlreadyRunning));
/// <summary>
/// Gets the error that reports that only a running scheduled job can be completed.
/// </summary>
public static Error CanOnlyCompleteRunningScheduledJob => Error.Forbidden(description: nameof(CanOnlyCompleteRunningScheduledJob));
/// <summary>
/// Gets the error that reports that the schedule type is not a defined value.
/// </summary>
public static Error InvalidScheduleType => Error.Validation(description: nameof(InvalidScheduleType));
/// <summary>
/// Gets the error that reports that the scheduler display time span must be a positive value.
/// </summary>
public static Error SchedulerDisplayTimeSpanMustBePositive => Error.Validation(description: nameof(SchedulerDisplayTimeSpanMustBePositive));
}
}
@@ -9,19 +9,69 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report theme rule violations and theme file failures.
/// </summary>
public static class Themes
{
/// <summary>
/// Gets the error that reports that the requested theme was not found.
/// </summary>
public static Error ThemeNotFound => Error.NotFound(description: nameof(ThemeNotFound));
/// <summary>
/// Gets the error that reports that the theme identifier cannot be empty.
/// </summary>
public static Error ThemeIdCannotBeEmpty => Error.Validation(description: nameof(ThemeIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the theme page key cannot be empty.
/// </summary>
public static Error PageKeyCannotBeEmpty => Error.Validation(description: nameof(PageKeyCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the theme asset path cannot be empty.
/// </summary>
public static Error ThemeAssetPathCannotBeEmpty => Error.Validation(description: nameof(ThemeAssetPathCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the theme archive must not be <see langword="null"/>.
/// </summary>
public static Error ThemeArchiveCannotBeNull => Error.Validation(description: nameof(ThemeArchiveCannotBeNull));
/// <summary>
/// Gets the error that reports that the last bundled theme cannot be deleted.
/// </summary>
public static Error LastBundledThemeCannotBeDeleted => Error.Forbidden(description: nameof(LastBundledThemeCannotBeDeleted));
/// <summary>
/// Gets the error that reports that the theme cannot be deleted.
/// </summary>
public static Error ThemeCannotBeDeleted => Error.Forbidden(description: nameof(ThemeCannotBeDeleted));
/// <summary>
/// Gets the error that reports that the theme cannot be restored.
/// </summary>
public static Error ThemeCannotBeRestored => Error.Forbidden(description: nameof(ThemeCannotBeRestored));
/// <summary>
/// Gets the error that reports that the theme archive could not be read.
/// </summary>
public static Error ThemeArchiveNotReadable => Error.Failure(description: nameof(ThemeArchiveNotReadable));
/// <summary>
/// Gets the error that reports that the files of the theme could not be read.
/// </summary>
public static Error ThemeFilesUnreadable => Error.Failure(description: nameof(ThemeFilesUnreadable));
/// <summary>
/// Gets the error that reports that the requested theme template was not found.
/// </summary>
public static Error ThemeTemplateNotFound => Error.NotFound(description: nameof(ThemeTemplateNotFound));
/// <summary>
/// Gets the error that reports that the theme is not available for the requested page.
/// </summary>
public static Error ThemeNotAvailable => Error.Failure(description: nameof(ThemeNotAvailable));
}
}
@@ -9,9 +9,19 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report thumbnail generation failures and image quality rule violations.
/// </summary>
public static class Thumbnails
{
/// <summary>
/// Gets the error that reports that no thumbnail is available for the requested media item.
/// </summary>
public static Error NoThumbnail => Error.Failure(description: nameof(NoThumbnail));
/// <summary>
/// Gets the error that reports that the image quality must be between 0 and 100.
/// </summary>
public static Error ImageQualityMustBeBetweenZeroAndOneHundred => Error.Validation(description: nameof(ImageQualityMustBeBetweenZeroAndOneHundred));
}
}
@@ -9,38 +9,164 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Defines the errors that report failures raised while working with user settings.
/// </summary>
public static class UserSettings
{
/// <summary>
/// Gets the error that reports that settings already exist for the user.
/// </summary>
public static Error UserSettingsAlreadyExists => Error.Conflict(description: nameof(UserSettingsAlreadyExists));
/// <summary>
/// Gets the error that reports that no settings exist for the requested user.
/// </summary>
public static Error UserSettingsNotFound => Error.NotFound(description: nameof(UserSettingsNotFound));
/// <summary>
/// Gets the error that reports that the number of items shown per page must be greater than zero.
/// </summary>
public static Error ItemsPerPageMustBeGreaterThanZero => Error.Validation(description: nameof(ItemsPerPageMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the playback volume cannot be <see langword="null"/>.
/// </summary>
public static Error VolumeCannotBeNull => Error.Validation(description: nameof(VolumeCannotBeNull));
/// <summary>
/// Gets the error that reports that the playback volume must be between 0 and 1, inclusive.
/// </summary>
public static Error VolumeMustBeBetweenZeroAndOne => Error.Validation(description: nameof(VolumeMustBeBetweenZeroAndOne));
/// <summary>
/// Gets the error that reports that the mute state cannot be <see langword="null"/>.
/// </summary>
public static Error IsMutedCannotBeNull => Error.Validation(description: nameof(IsMutedCannotBeNull));
/// <summary>
/// Gets the error that reports that the option to keep downloading while playback is paused cannot be <see langword="null"/>.
/// </summary>
public static Error ShouldKeepDownloadingWhilePausedCannotBeNull => Error.Validation(description: nameof(ShouldKeepDownloadingWhilePausedCannotBeNull));
/// <summary>
/// Gets the error that reports that the autoplay option cannot be <see langword="null"/>.
/// </summary>
public static Error ShouldAutoplayCannotBeNull => Error.Validation(description: nameof(ShouldAutoplayCannotBeNull));
/// <summary>
/// Gets the error that reports that the gapless playback option cannot be <see langword="null"/>.
/// </summary>
public static Error IsGaplessPlaybackEnabledCannotBeNull => Error.Validation(description: nameof(IsGaplessPlaybackEnabledCannotBeNull));
/// <summary>
/// Gets the error that reports that the replay gain mode cannot be <see langword="null"/>.
/// </summary>
public static Error ReplayGainModeCannotBeNull => Error.Validation(description: nameof(ReplayGainModeCannotBeNull));
/// <summary>
/// Gets the error that reports that the streaming quality cannot be <see langword="null"/>.
/// </summary>
public static Error StreamingQualityCannotBeNull => Error.Validation(description: nameof(StreamingQualityCannotBeNull));
/// <summary>
/// Gets the error that reports that the replay gain mode is not a recognized value.
/// </summary>
public static Error InvalidReplayGainMode => Error.Validation(description: nameof(InvalidReplayGainMode));
/// <summary>
/// Gets the error that reports that the streaming quality is not a recognized value.
/// </summary>
public static Error InvalidStreamingQuality => Error.Validation(description: nameof(InvalidStreamingQuality));
/// <summary>
/// Gets the error that reports that the VU meter orientation cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterOrientationCannotBeNull => Error.Validation(description: nameof(VuMeterOrientationCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter orientation is not a recognized value.
/// </summary>
public static Error InvalidVuMeterOrientation => Error.Validation(description: nameof(InvalidVuMeterOrientation));
/// <summary>
/// Gets the error that reports that the VU meter segment count cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterSegmentCountCannotBeNull => Error.Validation(description: nameof(VuMeterSegmentCountCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter segment count must be between 1 and 128, inclusive.
/// </summary>
public static Error VuMeterSegmentCountMustBeBetweenOneAndOneHundredTwentyEight => Error.Validation(description: nameof(VuMeterSegmentCountMustBeBetweenOneAndOneHundredTwentyEight));
/// <summary>
/// Gets the error that reports that the VU meter segment gap cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterSegmentGapCannotBeNull => Error.Validation(description: nameof(VuMeterSegmentGapCannotBeNull));
/// <summary>
/// Gets the error that reports that the gap between the VU meter segments, in pixels, must be between 0 and 32, inclusive.
/// </summary>
public static Error VuMeterSegmentGapMustBeBetweenZeroAndThirtyTwo => Error.Validation(description: nameof(VuMeterSegmentGapMustBeBetweenZeroAndThirtyTwo));
/// <summary>
/// Gets the error that reports that the VU meter medium threshold cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterMediumThresholdCannotBeNull => Error.Validation(description: nameof(VuMeterMediumThresholdCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter medium threshold must be between 0 and 1, inclusive.
/// </summary>
public static Error VuMeterMediumThresholdMustBeBetweenZeroAndOne => Error.Validation(description: nameof(VuMeterMediumThresholdMustBeBetweenZeroAndOne));
/// <summary>
/// Gets the error that reports that the VU meter high threshold cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterHighThresholdCannotBeNull => Error.Validation(description: nameof(VuMeterHighThresholdCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter high threshold must be between 0 and 1, inclusive.
/// </summary>
public static Error VuMeterHighThresholdMustBeBetweenZeroAndOne => Error.Validation(description: nameof(VuMeterHighThresholdMustBeBetweenZeroAndOne));
/// <summary>
/// Gets the error that reports that the VU meter high threshold is lower than its medium threshold.
/// </summary>
public static Error VuMeterHighThresholdMustBeGreaterThanOrEqualToMediumThreshold => Error.Validation(description: nameof(VuMeterHighThresholdMustBeGreaterThanOrEqualToMediumThreshold));
/// <summary>
/// Gets the error that reports that the option to show the VU meter peak cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterShowPeakCannotBeNull => Error.Validation(description: nameof(VuMeterShowPeakCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter peak hold duration cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterPeakHoldDurationCannotBeNull => Error.Validation(description: nameof(VuMeterPeakHoldDurationCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter peak hold duration, in milliseconds, must be between 0 and 10000, inclusive.
/// </summary>
public static Error VuMeterPeakHoldDurationMustBeBetweenZeroAndTenThousandMilliseconds => Error.Validation(description: nameof(VuMeterPeakHoldDurationMustBeBetweenZeroAndTenThousandMilliseconds));
/// <summary>
/// Gets the error that reports that the VU meter release rate per second cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterReleasePerSecondCannotBeNull => Error.Validation(description: nameof(VuMeterReleasePerSecondCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter release rate per second must be between 0 and 100, inclusive.
/// </summary>
public static Error VuMeterReleasePerSecondMustBeBetweenZeroAndOneHundred => Error.Validation(description: nameof(VuMeterReleasePerSecondMustBeBetweenZeroAndOneHundred));
/// <summary>
/// Gets the error that reports that the VU meter peak release rate per second cannot be <see langword="null"/>.
/// </summary>
public static Error VuMeterPeakReleasePerSecondCannotBeNull => Error.Validation(description: nameof(VuMeterPeakReleasePerSecondCannotBeNull));
/// <summary>
/// Gets the error that reports that the VU meter peak release rate per second must be between 0 and 100, inclusive.
/// </summary>
public static Error VuMeterPeakReleasePerSecondMustBeBetweenZeroAndOneHundred => Error.Validation(description: nameof(VuMeterPeakReleasePerSecondMustBeBetweenZeroAndOneHundred));
}
}
@@ -9,10 +9,24 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Groups the errors that report user rule violations and missing users.
/// </summary>
public static class Users
{
/// <summary>
/// Gets the error that reports that the user already exists.
/// </summary>
public static Error UserAlreadyExists => Error.Conflict(description: nameof(UserAlreadyExists));
/// <summary>
/// Gets the error that reports that the requested user does not exist.
/// </summary>
public static Error UserDoesNotExist => Error.NotFound(description: nameof(UserDoesNotExist));
/// <summary>
/// Gets the error that reports that the user identifier cannot be empty.
/// </summary>
public static Error UserIdCannotBeEmpty => Error.Validation(description: nameof(UserIdCannotBeEmpty));
}
}
@@ -9,38 +9,164 @@ namespace Lumina.Domain.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Defines the errors that report failures raised while working with books and book series.
/// </summary>
public static class WrittenContent
{
/// <summary>
/// Gets the error that reports that a book with the same identifier or file path already exists in the library.
/// </summary>
public static Error BookAlreadyExists => Error.Conflict(description: nameof(BookAlreadyExists));
/// <summary>
/// Gets the error that reports that an ISBN value cannot be empty.
/// </summary>
public static Error IsbnValueCannotBeEmpty => Error.Validation(description: nameof(IsbnValueCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the collection of ISBNs for a book cannot be <see langword="null"/>.
/// </summary>
public static Error IsbnListCannotBeNull => Error.Validation(description: nameof(IsbnListCannotBeNull));
/// <summary>
/// Gets the error that reports that an ISBN-10 value does not have a valid ISBN-10 format.
/// </summary>
public static Error InvalidIsbn10Format => Error.Validation(description: nameof(InvalidIsbn10Format));
/// <summary>
/// Gets the error that reports that an ISBN-13 value does not have a valid ISBN-13 format.
/// </summary>
public static Error InvalidIsbn13Format => Error.Validation(description: nameof(InvalidIsbn13Format));
/// <summary>
/// Gets the error that reports that an ISBN format is not a recognized ISBN-10 or ISBN-13 value.
/// </summary>
public static Error UnknownIsbnFormat => Error.Unexpected(description: nameof(UnknownIsbnFormat));
/// <summary>
/// Gets the error that reports that the book cannot be added to the series because the series already contains it.
/// </summary>
public static Error TheBookIsAlreadyInTheSeries => Error.Forbidden(description: nameof(TheBookIsAlreadyInTheSeries));
/// <summary>
/// Gets the error that reports that the book cannot be removed from the series because the series does not contain it.
/// </summary>
public static Error TheBookIsNotInTheSeries => Error.Forbidden(description: nameof(TheBookIsNotInTheSeries));
/// <summary>
/// Gets the error that reports that an ASIN must be exactly 10 characters long.
/// </summary>
public static Error AsinMustBe10CharactersLong => Error.Validation(description: nameof(AsinMustBe10CharactersLong));
/// <summary>
/// Gets the error that reports that a Goodreads identifier is not made of digits.
/// </summary>
public static Error GoodreadsIdMustBeNumeric => Error.Validation(description: nameof(GoodreadsIdMustBeNumeric));
/// <summary>
/// Gets the error that reports that an LCCN does not have a valid Library of Congress Control Number format.
/// </summary>
public static Error InvalidLccnFormat => Error.Validation(description: nameof(InvalidLccnFormat));
/// <summary>
/// Gets the error that reports that an OCLC number does not have a valid OCLC format.
/// </summary>
public static Error InvalidOclcFormat => Error.Validation(description: nameof(InvalidOclcFormat));
/// <summary>
/// Gets the error that reports that an Open Library identifier does not have a valid format.
/// </summary>
public static Error InvalidOpenLibraryId => Error.Validation(description: nameof(InvalidOpenLibraryId));
/// <summary>
/// Gets the error that reports that a LibraryThing identifier exceeds the maximum length of 50 characters.
/// </summary>
public static Error LibraryThingIdMustBeMaximum50CharactersLong => Error.Validation(description: nameof(LibraryThingIdMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that a Google Books identifier must be exactly 12 characters long.
/// </summary>
public static Error GoogleBooksIdMustBe12CharactersLong => Error.Validation(description: nameof(GoogleBooksIdMustBe12CharactersLong));
/// <summary>
/// Gets the error that reports that a Google Books identifier contains characters other than letters, digits, underscores and hyphens.
/// </summary>
public static Error InvalidGoogleBooksIdFormat => Error.Validation(description: nameof(InvalidGoogleBooksIdFormat));
/// <summary>
/// Gets the error that reports that a Barnes and Noble identifier must be exactly 10 characters long.
/// </summary>
public static Error BarnesAndNoblesIdMustBe10CharactersLong => Error.Validation(description: nameof(BarnesAndNoblesIdMustBe10CharactersLong));
/// <summary>
/// Gets the error that reports that a Barnes and Noble identifier is not made of digits.
/// </summary>
public static Error InvalidBarnesAndNoblesIdFormat => Error.Validation(description: nameof(InvalidBarnesAndNoblesIdFormat));
/// <summary>
/// Gets the error that reports that an Apple Books identifier does not have the expected id prefix followed by digits.
/// </summary>
public static Error InvalidAppleBooksIdFormat => Error.Validation(description: nameof(InvalidAppleBooksIdFormat));
/// <summary>
/// Gets the error that reports that the publisher of a book exceeds the maximum length of 100 characters.
/// </summary>
public static Error PublisherMustBeMaximum100CharactersLong => Error.Validation(description: nameof(PublisherMustBeMaximum100CharactersLong));
/// <summary>
/// Gets the error that reports that the page count of a book must be greater than zero.
/// </summary>
public static Error PageCountMustBeGreaterThanZero => Error.Validation(description: nameof(PageCountMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that a book format is not a recognized value.
/// </summary>
public static Error UnknownBookFormat => Error.Validation(description: nameof(UnknownBookFormat));
/// <summary>
/// Gets the error that reports that the edition of a book exceeds the maximum length of 50 characters.
/// </summary>
public static Error EditionMustBeMaximum50CharactersLong => Error.Validation(description: nameof(EditionMustBeMaximum50CharactersLong));
/// <summary>
/// Gets the error that reports that the volume number of a book must be greater than zero.
/// </summary>
public static Error VolumeNumberMustBeGreaterThanZero => Error.Validation(description: nameof(VolumeNumberMustBeGreaterThanZero));
/// <summary>
/// Gets the error that reports that the book library cannot be <see langword="null"/>.
/// </summary>
public static Error BookLibraryCannotBeNull => Error.Validation(description: nameof(BookLibraryCannotBeNull));
/// <summary>
/// Gets the error that reports that the file path of a book cannot be empty.
/// </summary>
public static Error BookPathCannotBeEmpty => Error.Validation(description: nameof(BookPathCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the file path of a book exceeds the maximum length of 2048 characters.
/// </summary>
public static Error BookPathMustBeMaximum2048CharactersLong => Error.Validation(description: nameof(BookPathMustBeMaximum2048CharactersLong));
/// <summary>
/// Gets the error that reports that a book file path does not reside within any of the content locations of the library.
/// </summary>
public static Error BookPathMustBeWithinLibraryContentLocations => Error.Validation(description: nameof(BookPathMustBeWithinLibraryContentLocations));
/// <summary>
/// Gets the error that reports that a book identifier cannot be empty.
/// </summary>
public static Error BookIdCannotBeEmpty => Error.Validation(description: nameof(BookIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports that the cover image of a book cannot be <see langword="null"/>.
/// </summary>
public static Error BookCoverCannotBeNull => Error.Validation(description: nameof(BookCoverCannotBeNull));
/// <summary>
/// Gets the error that reports that the requested book does not exist.
/// </summary>
public static Error BookNotFound => Error.NotFound(description: nameof(BookNotFound));
}
}
@@ -11,6 +11,9 @@ namespace Lumina.Domain.Common.Models.Core;
/// <typeparam name="TId">The type representing the unique identifier for the Aggregate Root. It should be a non-nullable type.</typeparam>
public abstract class AggregateRoot<TId> : Entity<TId> where TId : notnull
{
/// <summary>
/// The domain events raised by this aggregate root that have not been collected yet.
/// </summary>
protected readonly List<IDomainEvent> _domainEvents = [];
/// <summary>
@@ -1,6 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
using System;
@@ -49,6 +48,7 @@ public sealed class Directory : FileSystemItem
/// <summary>
/// Creates a new instance of the <see cref="Directory"/> class.
/// </summary>
/// <param name="path">The file system path of the directory.</param>
/// <param name="name">The name of the directory.</param>
/// <param name="dateCreated">The date and time the directory was created. Can be optional if unknown.</param>
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
@@ -86,6 +86,7 @@ public sealed class Directory : FileSystemItem
/// <summary>
/// Creates a new instance of the <see cref="Directory"/> class.
/// </summary>
/// <param name="id">The unique identifier of the directory in the file system path.</param>
/// <param name="name">The name of the directory.</param>
/// <param name="dateCreated">The date and time the directory was created. Can be optional if unknown.</param>
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
@@ -1,6 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
using Lumina.Domain.Common.Errors;
@@ -49,6 +48,7 @@ public sealed class File : FileSystemItem
/// <summary>
/// Creates a new instance of the <see cref="File"/> class.
/// </summary>
/// <param name="path">The file system path of the file.</param>
/// <param name="name">The name of the file.</param>
/// <param name="dateCreated">The date and time the file was created. Can be optional if unknown.</param>
/// <param name="dateModified">The date and time the file was last modified. Can be optional if unknown.</param>
@@ -24,6 +24,7 @@ public class DriveService : IDriveService
/// Initializes a new instance of the <see cref="DriveService"/> class.
/// </summary>
/// <param name="fileSystem">Injected service used to interact with the local filesystem.</param>
/// <param name="platformContextManager">Injected facade service for platform contextual services.</param>
public DriveService(IFileSystem fileSystem, IPlatformContextManager platformContextManager)
{
_fileSystem = fileSystem;
@@ -322,6 +322,14 @@ public class FileService : IFileService
return _environmentContext.FileProviderService.DeleteFile(path);
}
/// <summary>
/// Reads the file at the specified <paramref name="path"/>.
/// </summary>
/// <remarks>
/// This method is a placeholder that always reports success without reading the file, so it has no error path yet.
/// </remarks>
/// <param name="path">The identifier of the file system path of the file to read.</param>
/// <returns>A <see cref="Result{TValue}"/> that currently always contains <see langword="true"/>.</returns>
public Result<bool> ReadFile(FileSystemPathId path)
{
return true;
@@ -123,7 +123,7 @@ public class FileTypeService : IFileTypeService
/// Identifies the image type based on the provided header bytes.
/// </summary>
/// <param name="firstBytes">The first bytes of the file, typically used to identify the file type.</param>
/// <returns>The type of the image, or <see cref="{ImageType.None}"/> if unrecognized.</returns>
/// <returns>The type of the image, or <see cref="ImageType.None"/> if unrecognized.</returns>
private static ImageType IdentifyHeader(byte[] firstBytes)
{
if (Encoding.ASCII.GetBytes("BM").SequenceEqual(firstBytes[..2]))
@@ -35,7 +35,7 @@ public interface IPathService
/// Tries to combine <paramref name="path"/> with <paramref name="name"/>.
/// </summary>
/// <param name="path">The path to be combined.</param>
/// <param name="path">The name to be combined with the path.</param>
/// <param name="name">The name to be combined with the path.</param>
/// <returns>An <see cref="Result{TValue}"/> containing the combined path, or an error.</returns>
Result<string> CombinePath(string path, string name);
@@ -11,6 +11,9 @@ namespace Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.
/// </summary>
public interface IPathStrategy
{
/// <summary>
/// Gets the character used to separate path segments on the current platform.
/// </summary>
char PathSeparator { get; }
/// <summary>
@@ -32,7 +35,7 @@ public interface IPathStrategy
/// Tries to combine <paramref name="path"/> with <paramref name="name"/>.
/// </summary>
/// <param name="path">The path to be combined.</param>
/// <param name="path">The name to be combined with the path.</param>
/// <param name="name">The name to be combined with the path.</param>
/// <returns>An <see cref="Result{TValue}"/> containing the combined path, or an error.</returns>
Result<FileSystemPathId> CombinePath(FileSystemPathId path, string name);
@@ -19,6 +19,9 @@ public class UnixPathStrategy : IUnixPathStrategy
{
private readonly IFileSystem _fileSystem;
/// <summary>
/// Gets the character used to separate path segments on UNIX platforms.
/// </summary>
public char PathSeparator => '/';
/// <summary>
@@ -19,6 +19,9 @@ public class WindowsPathStrategy : IWindowsPathStrategy
{
private readonly IFileSystem _fileSystem;
/// <summary>
/// Gets the character used to separate path segments on Windows platforms.
/// </summary>
public char PathSeparator => '\\';
/// <summary>
@@ -16,6 +16,9 @@ namespace Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.Lib
/// </summary>
public abstract class MediaLibraryScanJob : IMediaLibraryScanJob
{
/// <summary>
/// The number of parent media library scan jobs whose payloads have completed and triggered this job. It is incremented atomically, because jobs can run in parallel.
/// </summary>
protected int parentsPayloadsExecuted;
/// <summary>
@@ -12,6 +12,10 @@ namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLi
[DebuggerDisplay("{Id}: {Title}")]
public sealed class Episode : Entity<EpisodeId>
{
/// <summary>
/// Initializes a new instance of the <see cref="Episode"/> class.
/// </summary>
/// <param name="id">The unique identifier of the episode.</param>
public Episode(EpisodeId id) : base(id)
{
}
@@ -12,6 +12,10 @@ namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLi
[DebuggerDisplay("{Id}: {Title}")]
public sealed class Season : Entity<SeasonId>
{
/// <summary>
/// Initializes a new instance of the <see cref="Season"/> class.
/// </summary>
/// <param name="id">The unique identifier of the season.</param>
public Season(SeasonId id) : base(id)
{
}
@@ -12,6 +12,10 @@ namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLi
[DebuggerDisplay("{Id}: {Title}")]
public sealed class TvShow : Entity<TvShowId>
{
/// <summary>
/// Initializes a new instance of the <see cref="TvShow"/> class.
/// </summary>
/// <param name="id">The unique identifier of the TV show.</param>
public TvShow(TvShowId id) : base(id)
{
}
@@ -93,7 +93,7 @@ public sealed class Book : AggregateRoot<BookId>
public Optional<string> GoogleBooksId { get; private set; }
/// <summary>
/// Gets the Barnes & Noble ID of the book, if applicable.
/// Gets the Barnes &amp; Noble ID of the book, if applicable.
/// </summary>
public Optional<string> BarnesAndNobleId { get; private set; }
@@ -136,7 +136,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="openLibraryId">The optional Open Library ID of the book.</param>
/// <param name="libraryThingId">The optional LibraryThing ID of the book.</param>
/// <param name="googleBooksId">The optional Google Books ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes & Noble ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes &amp; Noble ID of the book.</param>
/// <param name="appleBooksId">The optional Apple Books ID of the book.</param>
/// <param name="createdOnUtc">The date and time when the entity was created.</param>
/// <param name="updatedOnUtc">The date and time when the entity was last updated.</param>
@@ -208,7 +208,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="openLibraryId">The optional Open Library ID of the book.</param>
/// <param name="libraryThingId">The optional LibraryThing ID of the book.</param>
/// <param name="googleBooksId">The optional Google Books ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes & Noble ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes &amp; Noble ID of the book.</param>
/// <param name="appleBooksId">The optional Apple Books ID of the book.</param>
/// <param name="isbns">The list of ISBNs of the book.</param>
/// <param name="contributors">The list of media contributors of the book, each carrying the role the contributor played.</param>
@@ -282,7 +282,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="openLibraryId">The optional Open Library ID of the book.</param>
/// <param name="libraryThingId">The optional LibraryThing ID of the book.</param>
/// <param name="googleBooksId">The optional Google Books ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes & Noble ID of the book.</param>
/// <param name="barnesAndNobleId">The optional Barnes &amp; Noble ID of the book.</param>
/// <param name="appleBooksId">The optional Apple Books ID of the book.</param>
/// <param name="createdOnUtc">The date and time when the entity was created.</param>
/// <param name="updatedOnUtc">The date and time when the entity was last updated.</param>
@@ -13,6 +13,9 @@ namespace Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext
[DebuggerDisplay("{Value}")]
public sealed class BookSeriesId : ValueObject
{
/// <summary>
/// Gets the unique identifier value of the book series.
/// </summary>
public Guid Value { get; }
/// <summary>
-2
View File
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -9,45 +9,199 @@ namespace Lumina.Infrastructure.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Configuration error types.
/// </summary>
public static class Configuration
{
/// <summary>
/// Gets the error that reports a validation failure when the database connection string is empty.
/// </summary>
public static Error DatabaseConnectionStringCannotBeEmpty => Error.Validation(description: nameof(DatabaseConnectionStringCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the media root directory is empty.
/// </summary>
public static Error MediaRootDirectoryCannotBeEmpty => Error.Validation(description: nameof(MediaRootDirectoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the media libraries directory is empty.
/// </summary>
public static Error MediaLibrariesDirectoryCannotBeEmpty => Error.Validation(description: nameof(MediaLibrariesDirectoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the media books directory is empty.
/// </summary>
public static Error MediaBooksDirectoryCannotBeEmpty => Error.Validation(description: nameof(MediaBooksDirectoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the media music directory is empty.
/// </summary>
public static Error MediaMusicDirectoryCannotBeEmpty => Error.Validation(description: nameof(MediaMusicDirectoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the encryption secret key is empty.
/// </summary>
public static Error EncryptionSecretKeyCannotBeEmpty => Error.Validation(description: nameof(EncryptionSecretKeyCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the encryption secret key is not a valid Base64 string.
/// </summary>
public static Error EncryptionSecretKeyMustBeABase64String => Error.Validation(description: nameof(EncryptionSecretKeyMustBeABase64String));
/// <summary>
/// Gets the error that reports a validation failure when the JWT secret key is empty.
/// </summary>
public static Error JwtSecretKeyCannotBeEmpty => Error.Validation(description: nameof(JwtSecretKeyCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the JWT secret key is shorter than the required 32 characters.
/// </summary>
public static Error JwtSecretKeyTooShort => Error.Validation(description: nameof(JwtSecretKeyTooShort));
/// <summary>
/// Gets the error that reports a validation failure when the JWT expiry duration, in minutes, is not a positive number.
/// </summary>
public static Error JwtExpiryMinutesMustBePositive => Error.Validation(description: nameof(JwtExpiryMinutesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the JWT issuer is empty.
/// </summary>
public static Error JwtIssuerCannotBeEmpty => Error.Validation(description: nameof(JwtIssuerCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the JWT audience is empty.
/// </summary>
public static Error JwtAudienceCannotBeEmpty => Error.Validation(description: nameof(JwtAudienceCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when no cross-origin resource sharing origin is configured, or when one of the configured origins is empty.
/// </summary>
public static Error CorsOriginsCannotBeEmpty => Error.Validation(description: nameof(CorsOriginsCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when a configured cross-origin resource sharing origin is not the wildcard origin, is not an absolute HTTP or HTTPS URL, or ends with a slash.
/// </summary>
public static Error CorsOriginIsInvalid => Error.Validation(description: nameof(CorsOriginIsInvalid));
/// <summary>
/// Gets the error that reports a validation failure when the plugins directory is empty.
/// </summary>
public static Error PluginsDirectoryCannotBeEmpty => Error.Validation(description: nameof(PluginsDirectoryCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the theme storage path is empty.
/// </summary>
public static Error ThemeStoragePathCannotBeEmpty => Error.Validation(description: nameof(ThemeStoragePathCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the path of the bundled themes is empty.
/// </summary>
public static Error ThemeBundledThemesPathCannotBeEmpty => Error.Validation(description: nameof(ThemeBundledThemesPathCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the identifier of the default theme is empty.
/// </summary>
public static Error ThemeDefaultThemeIdCannotBeEmpty => Error.Validation(description: nameof(ThemeDefaultThemeIdCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the maximum allowed size of a theme archive, in bytes, is not a positive number.
/// </summary>
public static Error ThemeMaxArchiveBytesMustBePositive => Error.Validation(description: nameof(ThemeMaxArchiveBytesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the maximum allowed expanded size of a theme pack, in bytes, is not a positive number.
/// </summary>
public static Error ThemeMaxExpandedBytesMustBePositive => Error.Validation(description: nameof(ThemeMaxExpandedBytesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the maximum allowed size of a single file in a theme pack, in bytes, is not a positive number.
/// </summary>
public static Error ThemeMaxSingleFileBytesMustBePositive => Error.Validation(description: nameof(ThemeMaxSingleFileBytesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the maximum allowed number of entries in a theme pack archive is not a positive number.
/// </summary>
public static Error ThemeMaxEntriesMustBePositive => Error.Validation(description: nameof(ThemeMaxEntriesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the path of the ffmpeg binary is empty.
/// </summary>
public static Error TranscodingFfmpegPathCannotBeEmpty => Error.Validation(description: nameof(TranscodingFfmpegPathCannotBeEmpty));
/// <summary>
/// Gets the error that reports a validation failure when the maximum number of concurrent normalization jobs is not a positive number.
/// </summary>
public static Error TranscodingMaxConcurrentJobsMustBePositive => Error.Validation(description: nameof(TranscodingMaxConcurrentJobsMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the maximum number of concurrent normalization jobs exceeds 64.
/// </summary>
public static Error TranscodingMaxConcurrentJobsIsTooLarge => Error.Validation(description: nameof(TranscodingMaxConcurrentJobsIsTooLarge));
/// <summary>
/// Gets the error that reports a validation failure when the maximum number of concurrent normalization jobs per user is not a positive number.
/// </summary>
public static Error TranscodingMaxConcurrentJobsPerUserMustBePositive => Error.Validation(description: nameof(TranscodingMaxConcurrentJobsPerUserMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the maximum number of concurrent normalization jobs per user exceeds 64.
/// </summary>
public static Error TranscodingMaxConcurrentJobsPerUserIsTooLarge => Error.Validation(description: nameof(TranscodingMaxConcurrentJobsPerUserIsTooLarge));
/// <summary>
/// Gets the error that reports a validation failure when the maximum number of concurrent normalization jobs per user exceeds the global maximum.
/// </summary>
public static Error TranscodingMaxConcurrentJobsPerUserExceedsGlobal => Error.Validation(description: nameof(TranscodingMaxConcurrentJobsPerUserExceedsGlobal));
/// <summary>
/// Gets the error that reports a validation failure when the maximum size of the normalized audio cache, in bytes, is not a positive number.
/// </summary>
public static Error TranscodingMaxCacheBytesMustBePositive => Error.Validation(description: nameof(TranscodingMaxCacheBytesMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the normalization job timeout, in seconds, is not a positive number.
/// </summary>
public static Error TranscodingJobTimeoutMustBePositive => Error.Validation(description: nameof(TranscodingJobTimeoutMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the normalization job timeout exceeds 86400 seconds.
/// </summary>
public static Error TranscodingJobTimeoutIsTooLong => Error.Validation(description: nameof(TranscodingJobTimeoutIsTooLong));
/// <summary>
/// Gets the error that reports a validation failure when the eviction grace period of the normalized audio cache, in seconds, is not a positive number.
/// </summary>
public static Error TranscodingEvictionGraceSecondsMustBePositive => Error.Validation(description: nameof(TranscodingEvictionGraceSecondsMustBePositive));
/// <summary>
/// Gets the error that reports a validation failure when the eviction grace period of the normalized audio cache exceeds 86400 seconds.
/// </summary>
public static Error TranscodingEvictionGraceSecondsIsTooLong => Error.Validation(description: nameof(TranscodingEvictionGraceSecondsIsTooLong));
/// <summary>
/// Gets the error that reports a validation failure when the configured normalized audio cache directory is not a valid file system path.
/// </summary>
public static Error TranscodingCacheDirectoryIsInvalid => Error.Validation(description: nameof(TranscodingCacheDirectoryIsInvalid));
/// <summary>
/// Gets the error that reports a validation failure when the configured normalized audio cache directory is inside the media root, or is the media root itself.
/// </summary>
public static Error TranscodingCacheDirectoryIsInsideMediaRoot => Error.Validation(description: nameof(TranscodingCacheDirectoryIsInsideMediaRoot));
/// <summary>
/// Gets the error that reports a validation failure when the configured normalized audio cache directory contains the media root.
/// </summary>
public static Error TranscodingCacheDirectoryContainsMediaRoot => Error.Validation(description: nameof(TranscodingCacheDirectoryContainsMediaRoot));
/// <summary>
/// Gets the error that reports a validation failure when the configured normalized audio cache directory is a file system root, the application base directory or one of its ancestors, or overlaps the logs or plugins directories.
/// </summary>
public static Error TranscodingCacheDirectoryIsUnsafeLocation => Error.Validation(description: nameof(TranscodingCacheDirectoryIsUnsafeLocation));
/// <summary>
/// Gets the error that reports a validation failure when the default normalized audio cache directory, used when no cache directory is configured, is inside the media root.
/// </summary>
public static Error TranscodingDefaultCacheDirectoryIsInsideMediaRoot => Error.Validation(description: nameof(TranscodingDefaultCacheDirectoryIsInsideMediaRoot));
}
}
@@ -9,8 +9,14 @@ namespace Lumina.Infrastructure.Common.Errors;
/// </summary>
public static partial class Errors
{
/// <summary>
/// Media library scan error types.
/// </summary>
public static class LibraryScanning
{
/// <summary>
/// Gets the error that reports a failure when the progress tracker of a media library scan job could not be created.
/// </summary>
public static Error FailedToCreateScanJobProgress => Error.Failure(description: nameof(FailedToCreateScanJobProgress));
}
}
@@ -5,11 +5,14 @@ using System.Diagnostics;
namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing media settings.
/// Data transfer object for deserializing cross-origin resource sharing settings.
/// </summary>
[DebuggerDisplay("{SECTION_NAME}")]
public class CorsSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the cross-origin resource sharing settings.
/// </summary>
public const string SECTION_NAME = "CorsSettings";
/// <summary>
@@ -10,6 +10,9 @@ namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
[DebuggerDisplay("{SECTION_NAME}")]
public class DatabaseSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the database connection strings.
/// </summary>
public const string SECTION_NAME = "ConnectionStrings";
/// <summary>
@@ -5,15 +5,18 @@ using System.Diagnostics;
namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing media settings.
/// Data transfer object for deserializing encryption settings.
/// </summary>
[DebuggerDisplay("{SECTION_NAME}")]
public class EncryptionSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the encryption settings.
/// </summary>
public const string SECTION_NAME = "EncryptionSettings";
/// <summary>
/// Gets or sets the root directory where media files are stored.
/// Gets or sets the Base64 encoded secret key used to encrypt and decrypt protected data.
/// </summary>
public required string SecretKey { get; init; }
}
@@ -5,11 +5,14 @@ using System.Diagnostics;
namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing media settings.
/// Data transfer object for deserializing JSON Web Token settings.
/// </summary>
[DebuggerDisplay("{SECTION_NAME}")]
public class JwtSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the JSON Web Token settings.
/// </summary>
public const string SECTION_NAME = "JwtSettings";
/// <summary>
@@ -10,6 +10,9 @@ namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
[DebuggerDisplay("Section name: {SECTION_NAME}")]
public sealed class ThemeEngineOptionsDto
{
/// <summary>
/// The name of the configuration section that holds the theme engine settings.
/// </summary>
public const string SECTION_NAME = "ThemeEngine";
/// <summary>
@@ -10,6 +10,9 @@ namespace Lumina.Infrastructure.Common.Models.DTO.Configuration;
[DebuggerDisplay("Section name: {SECTION_NAME}")]
public sealed class TranscodingSettingsDto
{
/// <summary>
/// The name of the configuration section that holds the settings of the audio normalization pipeline.
/// </summary>
public const string SECTION_NAME = "TranscodingSettings";
/// <summary>
@@ -718,6 +718,7 @@ internal sealed class TrackNormalizationService : ITrackNormalizationService, ID
/// <summary>
/// Runs ffmpeg to write the normalized audio of a track into a temporary directory, and builds the index of the produced segments.
/// </summary>
/// <param name="cacheId">The opaque identifier of the cache entry the normalized audio is produced for.</param>
/// <param name="request">The track, the delivery decision and the quality cap the normalized audio is produced with.</param>
/// <param name="inputPath">The path of the private snapshot of the stored audio file, which was copied from the validated handle.</param>
/// <param name="format">The container and codec combination the normalized audio is produced in.</param>
@@ -470,7 +470,7 @@ internal sealed class MusicMediaLibraryScanMetadataEnricher : IMediaLibraryScanM
}
/// <summary>
/// Finds the media contributor with the name of the provided <paramref name="contributor"/>, or creates it, caching it by its normalized display name
/// Finds the media contributors with the names of the provided <paramref name="contributors"/>, or creates them, caching them by their normalized display name
/// so that a contributor is only created once even when the same person is discovered for many items of the same page.
/// </summary>
/// <param name="contributors">The metadata contributors to resolve.</param>
@@ -1,7 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Ganss.Xss;
using System;
using System.Collections.Generic;
#endregion
namespace Lumina.Infrastructure.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Reading;
@@ -12,6 +10,9 @@ namespace Lumina.Infrastructure.Core.MediaLibrary.WrittenContentLibrary.BookLibr
/// </summary>
public static class ReadingContentSanitizer
{
/// <summary>
/// The name of the attribute that carries the opaque key of a resource referenced by a reading section, which the reader replaces with the URL of the resource endpoint.
/// </summary>
public const string RESOURCE_ATTRIBUTE = "data-lumina-resource";
// The sanitizer that preserves the style attribute, used for the users who want the books to keep their original look, and the
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
@@ -5,8 +5,6 @@
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -32,7 +32,14 @@ namespace Lumina.Presentation.Api.Common.DependencyInjection;
[ExcludeFromCodeCoverage]
public static class PresentationApiLayerServices
{
/// <summary>
/// The name of the rate limiting policy applied to the authentication endpoints.
/// </summary>
public const string AUTHENTICATION_RATE_LIMIT_POLICY = "authenticationPolicy";
/// <summary>
/// The name of the rate limiting policy applied to the endpoints that stream tracks.
/// </summary>
public const string TRACK_STREAM_RATE_LIMIT_POLICY = "trackStreamPolicy";
/// <summary>
@@ -5,5 +5,8 @@ namespace Lumina.Presentation.Api.Common.Http;
/// </summary>
public static class HttpContextItemKeys
{
/// <summary>
/// The key under which the errors of the current HTTP request are stored in the items collection of the HTTP context.
/// </summary>
public const string ERRORS = "errors";
}
@@ -10,6 +10,9 @@ public static partial class ApiRoutes
/// </summary>
public static class Permissions
{
/// <summary>
/// The route for getting the authorization permissions.
/// </summary>
public const string GET_PERMISSIONS = "/auth/permissions";
}
}
@@ -10,10 +10,29 @@ public static partial class ApiRoutes
/// </summary>
public static class Roles
{
/// <summary>
/// The route for getting the permissions granted to a role.
/// </summary>
public const string GET_ROLE_PERMISSIONS_BY_ROLE_ID = "/auth/roles/{roleId}/permissions";
/// <summary>
/// The route for getting the roles.
/// </summary>
public const string GET_ROLES = "/auth/roles";
/// <summary>
/// The route for creating a role.
/// </summary>
public const string CREATE_ROLE = "/auth/roles";
/// <summary>
/// The route for updating a role.
/// </summary>
public const string UPDATE_ROLE = "/auth/roles";
/// <summary>
/// The route for deleting a role.
/// </summary>
public const string DELETE_ROLE = "/auth/roles/{roleId}";
}
}
@@ -10,9 +10,24 @@ public static partial class ApiRoutes
/// </summary>
public static class Favorites
{
/// <summary>
/// The route for getting the favorites of the current user.
/// </summary>
public const string GET_FAVORITES = "/users/me/favorites";
/// <summary>
/// The route for adding a media item to the favorites of the current user.
/// </summary>
public const string ADD_FAVORITE = "/users/me/favorites";
/// <summary>
/// The route for removing a media item from the favorites of the current user.
/// </summary>
public const string REMOVE_FAVORITE = "/users/me/favorites/{mediaKind}/{mediaItemId}";
/// <summary>
/// The route for getting the favorite status of a media item of the current user.
/// </summary>
public const string GET_FAVORITE_STATUS = "/users/me/favorites/status";
}
}
@@ -10,6 +10,9 @@ public static partial class ApiRoutes
/// </summary>
public static class Directories
{
/// <summary>
/// The route for getting the directories of a path.
/// </summary>
public const string GET_DIRECTORIES = "/directories/get-directories";
}
}
@@ -10,6 +10,9 @@ public static partial class ApiRoutes
/// </summary>
public static class Drives
{
/// <summary>
/// The route for getting the drives of the file system.
/// </summary>
public const string GET_DRIVES = "/drives/get-drives";
}
}
@@ -10,6 +10,9 @@ public static partial class ApiRoutes
/// </summary>
public static class FileSystem
{
/// <summary>
/// The route for getting the type of the file system.
/// </summary>
public const string GET_TYPES = "/file-system/get-type";
}
}
@@ -10,7 +10,14 @@ public static partial class ApiRoutes
/// </summary>
public static class Files
{
/// <summary>
/// The route for getting the files of a directory as a tree.
/// </summary>
public const string GET_TREE_FILES = "/files/get-tree-files";
/// <summary>
/// The route for getting the files of a directory.
/// </summary>
public const string GET_FILES = "/files/get-files";
}
}
@@ -10,12 +10,39 @@ public static partial class ApiRoutes
/// </summary>
public static class Path
{
/// <summary>
/// The route for getting the root of a file system path.
/// </summary>
public const string GET_PATH_ROOT = "/path/get-path-root";
/// <summary>
/// The route for getting the separator used by the file system paths of the current platform.
/// </summary>
public const string GET_PATH_SEPARATOR = "/path/get-path-separator";
/// <summary>
/// The route for getting the parent of a file system path.
/// </summary>
public const string GET_PATH_PARENT = "/path/get-path-parent";
/// <summary>
/// The route for combining the segments of a file system path.
/// </summary>
public const string COMBINE = "/path/combine";
/// <summary>
/// The route for splitting a file system path into its segments.
/// </summary>
public const string SPLIT = "/path/split";
/// <summary>
/// The route for validating a file system path.
/// </summary>
public const string VALIDATE = "/path/validate";
/// <summary>
/// The route for checking whether a file system path exists.
/// </summary>
public const string CHECK_PATH_EXISTS = "/path/check-path-exists";
}
}
@@ -10,6 +10,9 @@ public static partial class ApiRoutes
/// </summary>
public static class Thumbnails
{
/// <summary>
/// The route for getting the thumbnail of a file.
/// </summary>
public const string GET_THUMBNAIL = "/thumbnails/get-thumbnail";
}
}
Loaded 100 of 202 files, more files were not shown because too many files have changed in this diff. Show more