From 42a78a60778f6b8df63363d6a011bdac8b3c05ae Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sun, 23 Feb 2025 09:59:50 +0200 Subject: [PATCH] Improves code documentation --- .../Commands/RegisterUser/RegisterUserCommandHandler.cs | 8 ++++---- .../Services/MediaLibraryScanningService.cs | 3 ++- src/Lumina.Presentation.Api/Program.cs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Lumina.Application/Core/UsersManagement/Authentication/Commands/RegisterUser/RegisterUserCommandHandler.cs b/src/Lumina.Application/Core/UsersManagement/Authentication/Commands/RegisterUser/RegisterUserCommandHandler.cs index 88e5e6a2..d3286586 100644 --- a/src/Lumina.Application/Core/UsersManagement/Authentication/Commands/RegisterUser/RegisterUserCommandHandler.cs +++ b/src/Lumina.Application/Core/UsersManagement/Authentication/Commands/RegisterUser/RegisterUserCommandHandler.cs @@ -65,10 +65,10 @@ public class RegisterUserCommandHandler : IRequestHandler(); - ErrorOr getUserRResult = await userRepository.GetByUsernameAsync(request.Username!, cancellationToken).ConfigureAwait(false); - if (getUserRResult.IsError) - return getUserRResult.Errors; - else if (getUserRResult.Value is not null) + ErrorOr getUserResult = await userRepository.GetByUsernameAsync(request.Username!, cancellationToken).ConfigureAwait(false); + if (getUserResult.IsError) + return getUserResult.Errors; + else if (getUserResult.Value is not null) return Errors.Authentication.UsernameAlreadyExists; string? totpSecret = null; Guid id = Guid.NewGuid(); diff --git a/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryScanAggregate/Services/MediaLibraryScanningService.cs b/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryScanAggregate/Services/MediaLibraryScanningService.cs index d15cbd46..3e877891 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryScanAggregate/Services/MediaLibraryScanningService.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryScanAggregate/Services/MediaLibraryScanningService.cs @@ -81,7 +81,8 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService // get a media library scanner for the provided media library type IMediaTypeScanner scanner = _mediaLibraryScannerFactory.CreateLibraryScanner(libraryType); - // get the list of scan jobs for the retrieved scanner + // 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. List jobs = scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMedatadaFromWeb).ToList(); // count total jobs in the chain by traversing the job graph diff --git a/src/Lumina.Presentation.Api/Program.cs b/src/Lumina.Presentation.Api/Program.cs index db77a6f0..f7760785 100644 --- a/src/Lumina.Presentation.Api/Program.cs +++ b/src/Lumina.Presentation.Api/Program.cs @@ -57,7 +57,7 @@ public class Program logPath = Environment.GetEnvironmentVariable("LOG_PATH") ?? "/logs"; // use docker volume path builder.WebHost.ConfigureKestrel(options => { - options.ListenAnyIP(5214); // HTTP only + options.ListenAnyIP(5214); // HTTP only; also, the port is also the same port exposed in the Dockerfile }); } else