Fixes typos and replaces LINQ conversions with collection expressions

This commit is contained in:
BinaryAlley committed 2026-08-09 00:19:28 -07:00
1 parent adadec7f3b
commit 74e9030a18
75 files changed
+113 -113

No files matched your search

+2 -1
View File
@@ -28,7 +28,8 @@ For those with technical curiosities, here are some goodies to browse through:
3. [3.1 Component Web Client diagram](./docs/technical/architecture/3.1%20component-web-client-diagram.svg) 3. [3.1 Component Web Client diagram](./docs/technical/architecture/3.1%20component-web-client-diagram.svg)
4. [3.2 Component API Server diagram](./docs/technical/architecture/3.2%20component-api-server-diagram.svg) 4. [3.2 Component API Server diagram](./docs/technical/architecture/3.2%20component-api-server-diagram.svg)
5. [4.1 Code media library scanning diagram](./docs/technical/architecture/4.1%20code-media-library-scanning-diagram.svg) 5. [4.1 Code media library scanning diagram](./docs/technical/architecture/4.1%20code-media-library-scanning-diagram.svg)
- Also for Software Architects, you might want to take a look at the Architecture Decision Log, where you may find important stories from the past of Lumina's development, like [this one](./docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decission-record-0001.md), and others like it. - Also for Software Architects, you might want to take a look at the Architecture Decision Log, where you may find important stories from the past of Lumina's development, like [this one](./docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0001.md), and others like it.
## Contributing ## Contributing
Lumina welcomes community contributions. All forms of input, be it code, bug reports, or feature suggestions, are appreciated. Be sure to read the [guidelines](./docs/CONTRIBUTING.md) for contributing first! Lumina welcomes community contributions. All forms of input, be it code, bug reports, or feature suggestions, are appreciated. Be sure to read the [guidelines](./docs/CONTRIBUTING.md) for contributing first!
@@ -20,6 +20,6 @@ public interface IDomainEventsQueue
/// </summary> /// </summary>
/// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty. /// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty.
/// </param> /// </param>
/// <returns><see langword="true"/> if a domain event was successfuly dequeued, <see langword="false"/> otherwise.</returns> /// <returns><see langword="true"/> if a domain event was successfully dequeued, <see langword="false"/> otherwise.</returns>
bool TryDequeue(out IDomainEvent domainEvent); bool TryDequeue(out IDomainEvent domainEvent);
} }
@@ -18,7 +18,7 @@ public static class GenreDtoMapping
/// </summary> /// </summary>
/// <param name="dto">The DTO to be converted.</param> /// <param name="dto">The DTO to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Genre"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Genre"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Genre> ToDomainEntity(this GenreDto dto) public static ErrorOr<Genre> ToDomainEntity(this GenreDto dto)
{ {
@@ -41,7 +41,7 @@ public static class GenreEntityMapping
/// </summary> /// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param> /// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Genre"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Genre"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Genre> ToDomainEntity(this GenreEntity repositoryEntity) public static ErrorOr<Genre> ToDomainEntity(this GenreEntity repositoryEntity)
{ {
@@ -18,7 +18,7 @@ public static class TagDtoMapping
/// </summary> /// </summary>
/// <param name="dto">The DTO to be converted.</param> /// <param name="dto">The DTO to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Tag"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Tag"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Tag> ToDomainEntity(this TagDto dto) public static ErrorOr<Tag> ToDomainEntity(this TagDto dto)
{ {
@@ -41,7 +41,7 @@ public static class TagEntityMapping
/// </summary> /// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param> /// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Tag"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Tag"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Tag> ToDomainEntity(this TagEntity repositoryEntity) public static ErrorOr<Tag> ToDomainEntity(this TagEntity repositoryEntity)
{ {
@@ -30,7 +30,7 @@ public static class BookEntityMapping
/// </summary> /// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param> /// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Book"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Book"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Book> ToDomainEntity(this BookEntity repositoryEntity) public static ErrorOr<Book> ToDomainEntity(this BookEntity repositoryEntity)
{ {
@@ -20,7 +20,7 @@ public static class BookRatingDtoMapping
/// </summary> /// </summary>
/// <param name="dto">The DTO to be converted.</param> /// <param name="dto">The DTO to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="BookRating"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="BookRating"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<BookRating> ToDomainEntity(this BookRatingDto dto) public static ErrorOr<BookRating> ToDomainEntity(this BookRatingDto dto)
{ {
@@ -46,7 +46,7 @@ public static class BookRatingEntityMapping
/// </summary> /// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param> /// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="BookRating"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="BookRating"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<BookRating> ToDomainEntity(this BookRatingEntity repositoryEntity) public static ErrorOr<BookRating> ToDomainEntity(this BookRatingEntity repositoryEntity)
{ {
@@ -19,7 +19,7 @@ public static class IsbnDtoMapping
/// </summary> /// </summary>
/// <param name="dto">The DTO to be converted.</param> /// <param name="dto">The DTO to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Isbn"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Isbn"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Isbn> ToDomainEntity(this IsbnDto dto) public static ErrorOr<Isbn> ToDomainEntity(this IsbnDto dto)
{ {
@@ -42,7 +42,7 @@ public static class IsbnEntityMapping
/// </summary> /// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param> /// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Isbn"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Isbn"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Isbn> ToDomainEntity(this IsbnEntity repositoryEntity) public static ErrorOr<Isbn> ToDomainEntity(this IsbnEntity repositoryEntity)
{ {
@@ -44,7 +44,7 @@ public class AddRoleCommandHandler : IRequestHandler<AddRoleCommand, ErrorOr<Rol
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RoleResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RoleResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(AddRoleCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(AddRoleCommand request, CancellationToken cancellationToken)
{ {
@@ -44,7 +44,7 @@ public class UpdateRoleCommandHandler : IRequestHandler<UpdateRoleCommand, Error
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly updated <see cref="RoleResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully updated <see cref="RoleResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(UpdateRoleCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(UpdateRoleCommand request, CancellationToken cancellationToken)
{ {
@@ -66,7 +66,7 @@ public class SetupApplicationCommandHandler : IRequestHandler<SetupApplicationCo
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RegistrationResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RegistrationResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<RegistrationResponse>> Handle(SetupApplicationCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<RegistrationResponse>> Handle(SetupApplicationCommand request, CancellationToken cancellationToken)
{ {
@@ -47,7 +47,7 @@ public class GetEnabledLibrariesQueryHandler : IRequestHandler<GetEnabledLibrari
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetEnabledLibrariesQuery request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetEnabledLibrariesQuery request, CancellationToken cancellationToken)
{ {
@@ -63,9 +63,9 @@ public class GetEnabledLibrariesQueryHandler : IRequestHandler<GetEnabledLibrari
else else
{ {
// for regular users, only take the libraries that belong to them // for regular users, only take the libraries that belong to them
LibraryResponse[] userEnabledLibraries = getEnabledLibrariesResult.Value LibraryResponse[] userEnabledLibraries = [.. getEnabledLibrariesResult.Value
.Where(library => library.UserId == _currentUserService.UserId) .Where(library => library.UserId == _currentUserService.UserId)
.Select(library => library.ToResponse()).ToArray(); .Select(library => library.ToResponse())];
return ErrorOrFactory.From(userEnabledLibraries); return ErrorOrFactory.From(userEnabledLibraries);
} }
@@ -47,7 +47,7 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetLibrariesQuery request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetLibrariesQuery request, CancellationToken cancellationToken)
{ {
@@ -63,9 +63,9 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
else else
{ {
// for regular users, only take the libraries that belong to them // for regular users, only take the libraries that belong to them
LibraryResponse[] userLibraries = getLibrariesResult.Value LibraryResponse[] userLibraries = [.. getLibrariesResult.Value
.Where(library => library.UserId == _currentUserService.UserId) .Where(library => library.UserId == _currentUserService.UserId)
.Select(library => library.ToResponse()).ToArray(); .Select(library => library.ToResponse())];
return ErrorOrFactory.From(userLibraries); return ErrorOrFactory.From(userLibraries);
} }
@@ -48,7 +48,7 @@ public class GetLibraryQueryHandler : IRequestHandler<GetLibraryQuery, ErrorOr<L
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<LibraryResponse>> Handle(GetLibraryQuery request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<LibraryResponse>> Handle(GetLibraryQuery request, CancellationToken cancellationToken)
{ {
@@ -54,7 +54,7 @@ public class GetRunningLibraryScansQueryHandler : IRequestHandler<GetRunningLibr
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanProgress"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<IEnumerable<MediaLibraryScanProgressResponse>>> Handle(GetRunningLibraryScansQuery request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<IEnumerable<MediaLibraryScanProgressResponse>>> Handle(GetRunningLibraryScansQuery request, CancellationToken cancellationToken)
{ {
@@ -68,7 +68,7 @@ public class GetRunningLibraryScansQueryHandler : IRequestHandler<GetRunningLibr
LibraryScanEntity[] userRunningRepositoryLibraryScans = []; LibraryScanEntity[] userRunningRepositoryLibraryScans = [];
// admins can see all libraries // admins can see all libraries
if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false)) if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false))
userRunningRepositoryLibraryScans = getRunningScansResult.Value.ToArray(); userRunningRepositoryLibraryScans = [.. getRunningScansResult.Value];
else // for regular users, only take the libraries that belong to them else // for regular users, only take the libraries that belong to them
userRunningRepositoryLibraryScans = getRunningScansResult.Value userRunningRepositoryLibraryScans = getRunningScansResult.Value
.Where(libraryScan => libraryScan.UserId == _currentUserService.UserId).ToArray(); .Where(libraryScan => libraryScan.UserId == _currentUserService.UserId).ToArray();
@@ -45,7 +45,7 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<BookResponse>> Handle(AddBookCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<BookResponse>> Handle(AddBookCommand request, CancellationToken cancellationToken)
{ {
@@ -67,29 +67,29 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
Optional<BookRatingSource>.FromNullable(rating.Source.HasValue ? (BookRatingSource)(int)rating.Source : (BookRatingSource?)null), Optional<BookRatingSource>.FromNullable(rating.Source.HasValue ? (BookRatingSource)(int)rating.Source : (BookRatingSource?)null),
Optional<int>.FromNullable(rating.VoteCount))); Optional<int>.FromNullable(rating.VoteCount)));
// check if any of the results contain errors // check if any of the results contain errors
List<Error> errors = domainRatingsResult.Where(ratingResult => ratingResult.IsError).SelectMany(ratingResult => ratingResult.Errors).ToList(); List<Error> errors = [.. domainRatingsResult.Where(ratingResult => ratingResult.IsError).SelectMany(ratingResult => ratingResult.Errors)];
if (errors.Count != 0) // if there are errors, return them if (errors.Count != 0) // if there are errors, return them
return errors; return errors;
List<BookRating> domainRatings = domainRatingsResult.Select(rating => rating.Value).ToList(); List<BookRating> domainRatings = [.. domainRatingsResult.Select(rating => rating.Value)];
List<ErrorOr<Genre>> domainGenresResult = request.Metadata!.Genres!.ConvertAll(genre => Genre.Create(genre.Name!)); List<ErrorOr<Genre>> domainGenresResult = request.Metadata!.Genres!.ConvertAll(genre => Genre.Create(genre.Name!));
errors = domainGenresResult.Where(genreResult => genreResult.IsError).SelectMany(genreResult => genreResult.Errors).ToList(); errors = [.. domainGenresResult.Where(genreResult => genreResult.IsError).SelectMany(genreResult => genreResult.Errors)];
if (errors.Count != 0) if (errors.Count != 0)
return errors; return errors;
List<Genre> domainGenres = domainGenresResult.Select(genre => genre.Value).ToList(); List<Genre> domainGenres = [.. domainGenresResult.Select(genre => genre.Value)];
List<ErrorOr<Tag>> domainTagsResult = request.Metadata.Tags!.ConvertAll(tag => Tag.Create(tag.Name!)); List<ErrorOr<Tag>> domainTagsResult = request.Metadata.Tags!.ConvertAll(tag => Tag.Create(tag.Name!));
errors = domainTagsResult.Where(tagResult => tagResult.IsError).SelectMany(tagResult => tagResult.Errors).ToList(); errors = [.. domainTagsResult.Where(tagResult => tagResult.IsError).SelectMany(tagResult => tagResult.Errors)];
if (errors.Count != 0) if (errors.Count != 0)
return errors; return errors;
List<Tag> domainTags = domainTagsResult.Select(tag => tag.Value).ToList(); List<Tag> domainTags = [.. domainTagsResult.Select(tag => tag.Value)];
List<ErrorOr<Isbn>> domainIsbnsResult = request.ISBNs!.ConvertAll(isbn => Isbn.Create(isbn.Value!, (IsbnFormat)(int)isbn.Format!)); List<ErrorOr<Isbn>> domainIsbnsResult = request.ISBNs!.ConvertAll(isbn => Isbn.Create(isbn.Value!, (IsbnFormat)(int)isbn.Format!));
errors = domainIsbnsResult.Where(isbnResult => isbnResult.IsError).SelectMany(isbnResult => isbnResult.Errors).ToList(); errors = [.. domainIsbnsResult.Where(isbnResult => isbnResult.IsError).SelectMany(isbnResult => isbnResult.Errors)];
if (errors.Count != 0) if (errors.Count != 0)
return errors; return errors;
List<Isbn> domainIsbns = domainIsbnsResult.Select(isbn => isbn.Value).ToList(); List<Isbn> domainIsbns = [.. domainIsbnsResult.Select(isbn => isbn.Value)];
ErrorOr<ReleaseInfo> releaseInfoResult = ReleaseInfo.Create( ErrorOr<ReleaseInfo> releaseInfoResult = ReleaseInfo.Create(
Optional<DateOnly>.FromNullable(request.Metadata.ReleaseInfo!.OriginalReleaseDate), Optional<DateOnly>.FromNullable(request.Metadata.ReleaseInfo!.OriginalReleaseDate),
@@ -41,7 +41,7 @@ public class ChangePasswordCommandHandler : IRequestHandler<ChangePasswordComman
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="ChangePasswordResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="ChangePasswordResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<ChangePasswordResponse>> Handle(ChangePasswordCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<ChangePasswordResponse>> Handle(ChangePasswordCommand request, CancellationToken cancellationToken)
{ {
@@ -50,7 +50,7 @@ public class RecoverPasswordCommandHandler : IRequestHandler<RecoverPasswordComm
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RecoverPasswordResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RecoverPasswordResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<RecoverPasswordResponse>> Handle(RecoverPasswordCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<RecoverPasswordResponse>> Handle(RecoverPasswordCommand request, CancellationToken cancellationToken)
{ {
@@ -59,7 +59,7 @@ public class RegisterUserCommandHandler : IRequestHandler<RegisterUserCommand, E
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RegistrationResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RegistrationResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<RegistrationResponse>> Handle(RegisterUserCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<RegistrationResponse>> Handle(RegisterUserCommand request, CancellationToken cancellationToken)
{ {
@@ -59,7 +59,7 @@ public class LoginUserQueryHandler : IRequestHandler<LoginUserQuery, ErrorOr<Log
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LoginResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LoginResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<LoginResponse>> Handle(LoginUserQuery request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<LoginResponse>> Handle(LoginUserQuery request, CancellationToken cancellationToken)
{ {
@@ -48,7 +48,7 @@ public class UpdateUserRoleAndPermissionsCommandHandler : IRequestHandler<Update
/// <param name="request">The request to be handled.</param> /// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly updated <see cref="RoleResponse"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully updated <see cref="RoleResponse"/>, or an error message.
/// </returns> /// </returns>
public async ValueTask<ErrorOr<AuthorizationResponse>> Handle(UpdateUserRoleAndPermissionsCommand request, CancellationToken cancellationToken) public async ValueTask<ErrorOr<AuthorizationResponse>> Handle(UpdateUserRoleAndPermissionsCommand request, CancellationToken cancellationToken)
{ {
@@ -49,7 +49,7 @@ internal sealed class LibraryRepository : ILibraryRepository
/// <summary> /// <summary>
/// Gets a <see cref="LibraryEntity"/> identified by <paramref name="id"/> from the storage medium. /// Gets a <see cref="LibraryEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary> /// </summary>
/// <param name="id">The id of the library to get.</param> /// <param name="id">The Id of the library to get.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a <see cref="LibraryEntity"/> identified by <paramref name="id"/>, or an error.</returns> /// <returns>An <see cref="ErrorOr{TValue}"/> containing either a <see cref="LibraryEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<ErrorOr<LibraryEntity?>> GetByIdAsync(Guid id, CancellationToken cancellationToken) public async Task<ErrorOr<LibraryEntity?>> GetByIdAsync(Guid id, CancellationToken cancellationToken)
@@ -120,9 +120,9 @@ internal sealed class LibraryRepository : ILibraryRepository
} }
/// <summary> /// <summary>
/// Deletes a library by its ID. /// Deletes a library by its Id.
/// </summary> /// </summary>
/// <param name="id">The ID of the library to delete.</param> /// <param name="id">The Id of the library to delete.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns> /// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<ErrorOr<Deleted>> DeleteByIdAsync(Guid id, CancellationToken cancellationToken) public async Task<ErrorOr<Deleted>> DeleteByIdAsync(Guid id, CancellationToken cancellationToken)
@@ -32,7 +32,7 @@ public class Genre : ValueObject
/// </summary> /// </summary>
/// <param name="name">The value of the genre.</param> /// <param name="name">The value of the genre.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Genre"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Genre"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Genre> Create(string? name) public static ErrorOr<Genre> Create(string? name)
{ {
@@ -49,7 +49,7 @@ public class LanguageInfo : ValueObject
/// <param name="languageName">The full name of the language in English.</param> /// <param name="languageName">The full name of the language in English.</param>
/// <param name="nativeName">The optional native name of the language.</param> /// <param name="nativeName">The optional native name of the language.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LanguageInfo"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LanguageInfo"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<LanguageInfo> Create(string? languageCode, string? languageName, Optional<string> nativeName) public static ErrorOr<LanguageInfo> Create(string? languageCode, string? languageName, Optional<string> nativeName)
{ {
@@ -81,7 +81,7 @@ public class ReleaseInfo : ValueObject
/// <param name="releaseCountry">The optional country or region of release.</param> /// <param name="releaseCountry">The optional country or region of release.</param>
/// <param name="releaseVersion">The optional release version or edition.</param> /// <param name="releaseVersion">The optional release version or edition.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="ReleaseInfo"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="ReleaseInfo"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<ReleaseInfo> Create( public static ErrorOr<ReleaseInfo> Create(
Optional<DateOnly> originalReleaseDate, Optional<DateOnly> originalReleaseDate,
@@ -32,7 +32,7 @@ public class Tag : ValueObject
/// </summary> /// </summary>
/// <param name="name">The value of the tag.</param> /// <param name="name">The value of the tag.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Tag"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Tag"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Tag> Create(string? name) public static ErrorOr<Tag> Create(string? name)
{ {
@@ -102,7 +102,7 @@ public class AudioMetadata : BaseMetadata
/// <param name="genres">The genres of the audio.</param> /// <param name="genres">The genres of the audio.</param>
/// <param name="tags">The tags associated with the audio.</param> /// <param name="tags">The tags associated with the audio.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="AudioMetadata"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="AudioMetadata"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<AudioMetadata> Create( public static ErrorOr<AudioMetadata> Create(
string title, string title,
@@ -55,7 +55,7 @@ public sealed class Directory : FileSystemItem
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param> /// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
/// <param name="status">The status of the file system item.</param> /// <param name="status">The status of the file system item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Directory> Create( public static ErrorOr<Directory> Create(
string path, string path,
@@ -87,7 +87,7 @@ public sealed class Directory : FileSystemItem
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param> /// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
/// <param name="status">The status of the file system item.</param> /// <param name="status">The status of the file system item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Directory> Create( public static ErrorOr<Directory> Create(
FileSystemPathId id, FileSystemPathId id,
@@ -56,7 +56,7 @@ public sealed class File : FileSystemItem
/// <param name="size">The size of the file in bytes.</param> /// <param name="size">The size of the file in bytes.</param>
/// <param name="status">The status of the file system item.</param> /// <param name="status">The status of the file system item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<File> Create( public static ErrorOr<File> Create(
string path, string path,
@@ -92,7 +92,7 @@ public sealed class File : FileSystemItem
/// <param name="size">The size of the file in bytes.</param> /// <param name="size">The size of the file in bytes.</param>
/// <param name="status">The status of the file system item.</param> /// <param name="status">The status of the file system item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<File> Create( public static ErrorOr<File> Create(
FileSystemPathId id, FileSystemPathId id,
@@ -37,7 +37,7 @@ public sealed class UnixRootItem : FileSystemItem
/// </summary> /// </summary>
/// <param name="status">The status of the file system root item.</param> /// <param name="status">The status of the file system root item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="UnixRootItem"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="UnixRootItem"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<UnixRootItem> Create(FileSystemItemStatus status = FileSystemItemStatus.Accessible) public static ErrorOr<UnixRootItem> Create(FileSystemItemStatus status = FileSystemItemStatus.Accessible)
{ {
@@ -38,7 +38,7 @@ public sealed class WindowsRootItem : FileSystemItem
/// <param name="name">The name of the file system root item.</param> /// <param name="name">The name of the file system root item.</param>
/// <param name="status">The status of the file system root item.</param> /// <param name="status">The status of the file system root item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<WindowsRootItem> Create( public static ErrorOr<WindowsRootItem> Create(
string path, string path,
@@ -65,7 +65,7 @@ public sealed class WindowsRootItem : FileSystemItem
/// <param name="name">The name of the file system root item.</param> /// <param name="name">The name of the file system root item.</param>
/// <param name="status">The status of the file system root item.</param> /// <param name="status">The status of the file system root item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<WindowsRootItem> Create( public static ErrorOr<WindowsRootItem> Create(
FileSystemPathId id, FileSystemPathId id,
@@ -39,7 +39,7 @@ public sealed class FileSystemPathId : ValueObject
/// </summary> /// </summary>
/// <param name="path">The path of the file system item.</param> /// <param name="path">The path of the file system item.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="FileSystemPathId"/> or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="FileSystemPathId"/> or an error message.
/// </returns> /// </returns>
public static ErrorOr<FileSystemPathId> Create(string path) public static ErrorOr<FileSystemPathId> Create(string path)
{ {
@@ -49,7 +49,7 @@ public class PathSegment : ValueObject
/// <param name="isDirectory">Value indicating if the current path segment is a file system directory or not.</param> /// <param name="isDirectory">Value indicating if the current path segment is a file system directory or not.</param>
/// <param name="isDrive">Value indicating if the current path segment is a file system drive or not.</param> /// <param name="isDrive">Value indicating if the current path segment is a file system drive or not.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="PathSegment"/> or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="PathSegment"/> or an error message.
/// </returns> /// </returns>
public static ErrorOr<PathSegment> Create(string name, bool isDirectory, bool isDrive) public static ErrorOr<PathSegment> Create(string name, bool isDirectory, bool isDrive)
{ {
@@ -98,7 +98,7 @@ public class StreamInfo : ValueObject
/// <param name="sampleRate">The sample rate of the stream (for audio).</param> /// <param name="sampleRate">The sample rate of the stream (for audio).</param>
/// <param name="channels">The number of channels (for audio).</param> /// <param name="channels">The number of channels (for audio).</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="StreamInfo"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="StreamInfo"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<StreamInfo> Create( public static ErrorOr<StreamInfo> Create(
string streamId, string streamId,
@@ -61,7 +61,7 @@ public class LibraryScan : AggregateRoot<ScanId>
/// <param name="userId">The object representing the unique identifier of the user initiating the media library scan.</param> /// <param name="userId">The object representing the unique identifier of the user initiating the media library scan.</param>
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param> /// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<LibraryScan> Create(LibraryId libraryId, UserId userId, List<LibraryScan> pastScans) public static ErrorOr<LibraryScan> Create(LibraryId libraryId, UserId userId, List<LibraryScan> pastScans)
{ {
@@ -77,7 +77,7 @@ public class LibraryScan : AggregateRoot<ScanId>
/// <param name="status">The status of the media library scan.</param> /// <param name="status">The status of the media library scan.</param>
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param> /// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<LibraryScan> Create(ScanId id, LibraryId libraryId, UserId userId, LibraryScanJobStatus status, List<LibraryScan> pastScans) public static ErrorOr<LibraryScan> Create(ScanId id, LibraryId libraryId, UserId userId, LibraryScanJobStatus status, List<LibraryScan> pastScans)
{ {
@@ -17,10 +17,10 @@ public interface IMediaLibraryScanningService
/// </summary> /// </summary>
/// <param name="scan">The media library scan to start.</param> /// <param name="scan">The media library scan to start.</param>
/// <param name="libraryType">The type of the media library to be scanned.</param> /// <param name="libraryType">The type of the media library to be scanned.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param> /// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns> /// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken); Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Cancels <paramref name="scan"/>. /// Cancels <paramref name="scan"/>.
@@ -12,7 +12,6 @@ using Lumina.Domain.Core.BoundedContexts.UserManagementBoundedContext.UserAggreg
using Mediator; using Mediator;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
#endregion #endregion
@@ -57,10 +56,10 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
/// </summary> /// </summary>
/// <param name="scan">The media library scan to start.</param> /// <param name="scan">The media library scan to start.</param>
/// <param name="libraryType">The type of the media library to be scanned.</param> /// <param name="libraryType">The type of the media library to be scanned.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param> /// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param> /// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns> /// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken) public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken)
{ {
// mark the scan itself as started // mark the scan itself as started
ErrorOr<Success> startScanResult = scan.StartScan(); ErrorOr<Success> startScanResult = scan.StartScan();
@@ -76,14 +75,14 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
try try
{ {
// link the user's cancellation token with the scan's token // link the user's cancellation token with the scan's token
CancellationTokenSource linkedSource = CancellationTokenSource using CancellationTokenSource linkedSource = CancellationTokenSource
.CreateLinkedTokenSource(cancellationToken, _mediaLibrariesScanCancellationTracker.GetTokenForScan(MediaLibraryScanCompositeId.Create(scan.Id, scan.UserId))); .CreateLinkedTokenSource(cancellationToken, _mediaLibrariesScanCancellationTracker.GetTokenForScan(MediaLibraryScanCompositeId.Create(scan.Id, scan.UserId)));
// get a media library scanner for the provided media library type // get a media library scanner for the provided media library type
IMediaTypeScanner scanner = _mediaLibraryScannerFactory.CreateLibraryScanner(libraryType); IMediaTypeScanner scanner = _mediaLibraryScannerFactory.CreateLibraryScanner(libraryType);
// get the list of scan jobs for the retrieved scanner. It is impotant to enumerate them here, because deferred execuction would destroy any graph relationships // get the list of scan jobs for the retrieved scanner. It is impotant to enumerate them here, because deferred execuction would destroy any graph relationships
// and properties we might set before putting the jobs on the in-memory queue. // and properties we might set before putting the jobs on the in-memory queue.
List<IMediaLibraryScanJob> jobs = scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMedatadaFromWeb).ToList(); List<IMediaLibraryScanJob> jobs = [.. scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMetadataFromWeb)];
// count total jobs in the chain by traversing the job graph // count total jobs in the chain by traversing the job graph
int totalJobs = CountTotalJobs(jobs); int totalJobs = CountTotalJobs(jobs);
@@ -21,7 +21,7 @@ public interface IMediaTypeScanner
/// Creates the media library scan jobs for the provided media library. /// Creates the media library scan jobs for the provided media library.
/// </summary> /// </summary>
/// <param name="libraryId">The unique identifier of the media library for which to create the media library scan jobs.</param> /// <param name="libraryId">The unique identifier of the media library for which to create the media library scan jobs.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param> /// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <returns>A collection of media library scan jobs.</returns> /// <returns>A collection of media library scan jobs.</returns>
IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMedatadaFromWeb); IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMetadataFromWeb);
} }
@@ -54,7 +54,7 @@ public sealed class MediaLibraryScanJobProgress : ValueObject
/// <param name="totalItems">The total number of items of the media library scan job.</param> /// <param name="totalItems">The total number of items of the media library scan job.</param>
/// <param name="currentOperation">The current operation being performed by the media library scan job.</param> /// <param name="currentOperation">The current operation being performed by the media library scan job.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanJobProgress"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanJobProgress"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<MediaLibraryScanJobProgress> Create(int completedItems, int totalItems, string currentOperation) public static ErrorOr<MediaLibraryScanJobProgress> Create(int completedItems, int totalItems, string currentOperation)
{ {
@@ -97,7 +97,7 @@ public sealed class MediaLibraryScanProgress : ValueObject
/// <param name="status">The status of the media library scan.</param> /// <param name="status">The status of the media library scan.</param>
/// <param name="currentJobProgress">The optional current job progress of the media library scan.</param> /// <param name="currentJobProgress">The optional current job progress of the media library scan.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanProgress"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<MediaLibraryScanProgress> Create( public static ErrorOr<MediaLibraryScanProgress> Create(
ScanId scanId, ScanId scanId,
@@ -33,7 +33,7 @@ public sealed class User : AggregateRoot<UserId>
/// </summary> /// </summary>
/// <param name="username">The username of the user.</param> /// <param name="username">The username of the user.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<User> Create(string username) public static ErrorOr<User> Create(string username)
{ {
@@ -46,7 +46,7 @@ public sealed class User : AggregateRoot<UserId>
/// <param name="id">The object representing the unique identifier of the user.</param> /// <param name="id">The object representing the unique identifier of the user.</param>
/// <param name="username">The username of the user.</param> /// <param name="username">The username of the user.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<User> Create(UserId id, string username) public static ErrorOr<User> Create(UserId id, string username)
{ {
@@ -96,7 +96,7 @@ public class VideoMetadata : BaseMetadata
/// <param name="genres">The genres of the video.</param> /// <param name="genres">The genres of the video.</param>
/// <param name="tags">The tags associated with the video.</param> /// <param name="tags">The tags associated with the video.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="VideoMetadata"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="VideoMetadata"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<VideoMetadata> Create( public static ErrorOr<VideoMetadata> Create(
string title, string title,
@@ -196,7 +196,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param> /// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
/// <param name="ratings">The list of ratings for the book.</param> /// <param name="ratings">The list of ratings for the book.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Book> Create( public static ErrorOr<Book> Create(
WrittenContentMetadata metadata, WrittenContentMetadata metadata,
@@ -266,7 +266,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param> /// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
/// <param name="ratings">The list of ratings for the book.</param> /// <param name="ratings">The list of ratings for the book.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<Book> Create( public static ErrorOr<Book> Create(
BookId id, BookId id,
@@ -56,7 +56,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
/// <param name="isComplete">The current status of the book series.</param> /// <param name="isComplete">The current status of the book series.</param>
/// <param name="books">The books of the book series.</param> /// <param name="books">The books of the book series.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<BookSeries> Create( public static ErrorOr<BookSeries> Create(
BookSeriesId id, BookSeriesId id,
@@ -80,7 +80,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
/// <param name="isComplete">The current status of the book series.</param> /// <param name="isComplete">The current status of the book series.</param>
/// <param name="books">The books of the book series.</param> /// <param name="books">The books of the book series.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<BookSeries> Create( public static ErrorOr<BookSeries> Create(
WrittenContentMetadata metadata, WrittenContentMetadata metadata,
@@ -42,7 +42,7 @@ public class BookRating : Rating
/// <param name="source">The optional source of the rating.</param> /// <param name="source">The optional source of the rating.</param>
/// <param name="voteCount">The optional number of votes or reviews.</param> /// <param name="voteCount">The optional number of votes or reviews.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Rating"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Rating"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<BookRating> Create(decimal value, decimal maxValue, Optional<BookRatingSource> source, Optional<int> voteCount) public static ErrorOr<BookRating> Create(decimal value, decimal maxValue, Optional<BookRatingSource> source, Optional<int> voteCount)
{ {
@@ -69,7 +69,7 @@ public class WrittenContentMetadata : BaseMetadata
/// <param name="publisher">The publisher of the written content, if applicable.</param> /// <param name="publisher">The publisher of the written content, if applicable.</param>
/// <param name="pageCount">The number of pages in the written content, if applicable.</param> /// <param name="pageCount">The number of pages in the written content, if applicable.</param>
/// <returns> /// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WrittenContentMetadata"/>, or an error message. /// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WrittenContentMetadata"/>, or an error message.
/// </returns> /// </returns>
public static ErrorOr<WrittenContentMetadata> Create( public static ErrorOr<WrittenContentMetadata> Create(
string title, string title,
@@ -27,7 +27,7 @@ public class DomainEventsQueue : IDomainEventsQueue
/// </summary> /// </summary>
/// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty. /// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty.
/// </param> /// </param>
/// <returns><see langword="true"/> if a domain event was successfuly dequeued, <see langword="false"/> otherwise.</returns> /// <returns><see langword="true"/> if a domain event was successfully dequeued, <see langword="false"/> otherwise.</returns>
public bool TryDequeue(out IDomainEvent domainEvent) public bool TryDequeue(out IDomainEvent domainEvent)
{ {
return _queue.TryDequeue(out domainEvent!); return _queue.TryDequeue(out domainEvent!);
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace Lumina.Presentation.Api.Common.Middlewares; namespace Lumina.Presentation.Api.Common.Middlewares;
/// <summary> /// <summary>
/// Middleware that ensures eventual consistency by handling domain events and publishing them after the request has completed successfuly. /// Middleware that ensures eventual consistency by handling domain events and publishing them after the request has completed successfully.
/// </summary> /// </summary>
public class EventualConsistencyMiddleware public class EventualConsistencyMiddleware
{ {
@@ -52,9 +52,9 @@ public class EventualConsistencyMiddleware
{ {
// commit the transaction: because some domain events trigger jobs that end up being processed in background hosted services, and those are // commit the transaction: because some domain events trigger jobs that end up being processed in background hosted services, and those are
// singletons that require their own DI scope to be created, any changes made on the DbContext in this HTTP scope would not be seen on the // singletons that require their own DI scope to be created, any changes made on the DbContext in this HTTP scope would not be seen on the
// DbContext created in the background service scope, because the transaction is not yet commited here; therefor, the transaction needs to be // DbContext created in the background service scope, because the transaction is not yet committed here; therefor, the transaction needs to be
// commited first, before any domain events are fired // committed first, before any domain events are fired
// see docs/technical/achitecture/architecture-knowledge-management/architecture-decision-log/architecture-decission-record-0002.md for details: // see docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0002.md for details:
await transaction.CommitAsync().ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false);
// check if domain events exist in the channel queue and publish them // check if domain events exist in the channel queue and publish them
@@ -40,7 +40,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity."); ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity.");
Response(200, "The authorization role was successfuly created.", example: Response(200, "The authorization role was successfully created.", example:
new RolePermissionsResponse( new RolePermissionsResponse(
Role: new RoleDto(Id: Guid.NewGuid(), "Editor"), Role: new RoleDto(Id: Guid.NewGuid(), "Editor"),
Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)] Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)]
@@ -30,7 +30,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
RequestParam(r => r.RoleId, "The unique identifier of the role. Required."); RequestParam(r => r.RoleId, "The unique identifier of the role. Required.");
Response(204, "The authorization role was successfuly deleted."); Response(204, "The authorization role was successfully deleted.");
Response(401, "Authentication required.", "application/problem+json", Response(401, "Authentication required.", "application/problem+json",
example: new[] example: new[]
@@ -42,7 +42,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity."); ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity.");
Response(200, "The authorization role was successfuly updated.", example: Response(200, "The authorization role was successfully updated.", example:
new RolePermissionsResponse( new RolePermissionsResponse(
Role: new RoleDto(Id: Guid.NewGuid(), "Editor"), Role: new RoleDto(Id: Guid.NewGuid(), "Editor"),
Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)] Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)]
@@ -28,7 +28,7 @@ public class SplitPathEndpointSummary : Summary<SplitPathEndpoint, SplitPathRequ
RequestParam(r => r.Path, "The file system path for which to get the path segments. Required."); RequestParam(r => r.Path, "The file system path for which to get the path segments. Required.");
Response(200, "successfuly split the path into segments.", Response(200, "successfully split the path into segments.",
example: new PathSegmentResponse[2] { example: new PathSegmentResponse[2] {
new(Path: "media"), new(Path: "media"),
new(Path: "movies") new(Path: "movies")
@@ -30,7 +30,7 @@ public class DeleteLibraryEndpointSummary : Summary<DeleteLibraryEndpoint, Delet
RequestParam(r => r.Id, "The unique identifier of the media library to be deleted. Required."); RequestParam(r => r.Id, "The unique identifier of the media library to be deleted. Required.");
Response(200, "The media library was successfuly deleted."); Response(200, "The media library was successfully deleted.");
Response(401, "Authentication required.", "application/problem+json", Response(401, "Authentication required.", "application/problem+json",
example: new[] example: new[]
@@ -43,7 +43,7 @@ public class UpdateUserRoleAndPermissionsEndpointSummary : Summary<UpdateUserRol
ResponseParam<AuthorizationResponse>(r => r.Permissions, "The list of permissions of the user."); ResponseParam<AuthorizationResponse>(r => r.Permissions, "The list of permissions of the user.");
Response(200, "The authorization role and permissions of the user were successfuly updated.", example: Response(200, "The authorization role and permissions of the user were successfully updated.", example:
new AuthorizationResponse( new AuthorizationResponse(
UserId: Guid.NewGuid(), UserId: Guid.NewGuid(),
Role: "Editor", Role: "Editor",
+3 -3
View File
@@ -188,9 +188,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-knowledge-mana
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-decision-log", "architecture-decision-log", "{788FADE4-342D-4919-8E5C-10CA8EDBE954}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-decision-log", "architecture-decision-log", "{788FADE4-342D-4919-8E5C-10CA8EDBE954}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0001.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0001.md ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0001.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0001.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0002.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0002.md ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0002.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0002.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0003.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0003.md ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0003.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0003.md
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
@@ -180,7 +180,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory"); string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -84,7 +84,7 @@ public class GetTypeEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5)); using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -220,7 +220,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory"); string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -220,7 +220,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory"); string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -100,7 +100,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string originalPath = "/home/user"; string originalPath = "/home/user";
@@ -171,7 +171,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory"); string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -128,7 +128,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
string testPath = System.IO.Path.GetTempPath(); string testPath = System.IO.Path.GetTempPath();
@@ -83,7 +83,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5)); using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -60,7 +60,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationsuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationSuccessfully()
{ {
// Arrange // Arrange
RegistrationRequest request = new( RegistrationRequest request = new(
@@ -94,7 +94,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationsuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationSuccessfully()
{ {
// Arrange // Arrange
RegistrationRequest request = new( RegistrationRequest request = new(
@@ -54,7 +54,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordsuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
{ {
// Arrange // Arrange
ChangePasswordRequest request = new( ChangePasswordRequest request = new(
@@ -68,7 +68,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginsuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
{ {
// Arrange // Arrange
UserEntity user = await CreateTestUser(); UserEntity user = await CreateTestUser();
@@ -95,7 +95,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginsuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
{ {
// Arrange // Arrange
UserEntity user = await CreateTestUserWithTotp(); UserEntity user = await CreateTestUserWithTotp();
@@ -127,7 +127,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginsuccessfuly() public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
{ {
// Arrange // Arrange
UserEntity user = await CreateTestUserWithTempPassword(); UserEntity user = await CreateTestUserWithTempPassword();
@@ -57,7 +57,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUsersuccessfuly() public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
{ {
// Arrange // Arrange
RegistrationRequest request = new( RegistrationRequest request = new(
@@ -65,7 +65,7 @@ public class GetBooksEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
} }
[Fact] [Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly() public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5)); using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -58,7 +58,7 @@ public class LoginEndpointTests : IClassFixture<LuminaApiFactory>, IDisposable
} }
[Fact] [Fact]
public async Task Login_WithValidCredentials_ShouldAuthenticatesuccessfuly() public async Task Login_WithValidCredentials_ShouldAuthenticateSuccessfully()
{ {
// Arrange // Arrange
UserEntity user = await CreateTestUser(); UserEntity user = await CreateTestUser();
@@ -83,7 +83,7 @@ public class GetPathSeparatorQueryHandlerTests
} }
[Fact] [Fact]
public async Task Handle_WithCancellationToken_ShouldCompletesuccessfuly() public async Task Handle_WithCancellationToken_ShouldCompleteSuccessfully()
{ {
// Arrange // Arrange
GetPathSeparatorQuery query = new(); GetPathSeparatorQuery query = new();
@@ -847,7 +847,7 @@ public class DirectoryProviderServiceTests
} }
[Fact] [Fact]
public void RenameDirectory_WhenParentDirectoryIsWritable_ShouldRenamesuccessfuly() public void RenameDirectory_WhenParentDirectoryIsWritable_ShouldRenameSuccessfully()
{ {
// Arrange // Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId( FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -971,7 +971,7 @@ public class DirectoryProviderServiceTests
} }
[Fact] [Fact]
public void DeleteDirectory_WhenDirectoryExistsAndHasDeletePermission_ShouldDeletesuccessfuly() public void DeleteDirectory_WhenDirectoryExistsAndHasDeletePermission_ShouldDeleteSuccessfully()
{ {
// Arrange // Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId( FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -737,7 +737,7 @@ public class FileProviderServiceTests
} }
[Fact] [Fact]
public void RenameFile_WhenParentDirectoryIsWritable_ShouldRenamesuccessfuly() public void RenameFile_WhenParentDirectoryIsWritable_ShouldRenameSuccessfully()
{ {
// Arrange // Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId( FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -894,7 +894,7 @@ public class FileProviderServiceTests
} }
[Fact] [Fact]
public void DeleteFile_WhenFileExistsAndHasDeletePermission_ShouldDeletesuccessfuly() public void DeleteFile_WhenFileExistsAndHasDeletePermission_ShouldDeleteSuccessfully()
{ {
// Arrange // Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId( FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(