diff --git a/docs/technical/api/scheduling/Api.Scheduling.md b/docs/technical/api/scheduling/Api.Scheduling.md
index a93ec99e..fcc99550 100644
--- a/docs/technical/api/scheduling/Api.Scheduling.md
+++ b/docs/technical/api/scheduling/Api.Scheduling.md
@@ -23,6 +23,12 @@
- [Fire Scheduled Job](#fire-scheduled-job)
- [Fire Scheduled Job Request](#fire-scheduled-job-request)
- [Fire Scheduled Job Response](#fire-scheduled-job-response)
+ - [Get Scheduler Display Preferences](#get-scheduler-display-preferences)
+ - [Get Scheduler Display Preferences Request](#get-scheduler-display-preferences-request)
+ - [Get Scheduler Display Preferences Response](#get-scheduler-display-preferences-response)
+ - [Update Scheduler Display Preferences](#update-scheduler-display-preferences)
+ - [Update Scheduler Display Preferences Request](#update-scheduler-display-preferences-request)
+ - [Update Scheduler Display Preferences Response](#update-scheduler-display-preferences-response)
## Scheduled Jobs
@@ -60,12 +66,57 @@ POST api/v1/scheduled-jobs
"intervalMinutes": null,
"hour": 3,
"minute": 0,
- "status": "Added",
+ "status": "Active",
"lastStartedOnUtc": null,
"lastCompletedOnUtc": null
}
```
+### Get Scheduler Display Preferences
+
+#### Get Scheduler Display Preferences Request
+
+```js
+GET api/v1/scheduled-jobs/display-preferences
+```
+
+#### Get Scheduler Display Preferences Response
+
+```js
+200 Ok
+```
+
+```json
+{
+ "userId": "2cff0c0f-3a67-4e30-b94f-f4e948a3b64f",
+ "jobTypeFilter": "ScanMediaLibraries",
+ "displayTimeSpan": 10,
+ "displayTimeUnit": "Minutes"
+}
+```
+
+### Update Scheduler Display Preferences
+
+#### Update Scheduler Display Preferences Request
+
+```js
+PUT api/v1/scheduled-jobs/display-preferences
+```
+
+```json
+{
+ "jobTypeFilter": "ScanMediaLibraries",
+ "displayTimeSpan": 10,
+ "displayTimeUnit": "Minutes"
+}
+```
+
+#### Update Scheduler Display Preferences Response
+
+```js
+200 Ok
+```
+
### Get Scheduled Jobs
#### Get Scheduled Jobs Request
diff --git a/docs/technical/requests/scheduling/GetSchedulerDisplayPreferences.http b/docs/technical/requests/scheduling/GetSchedulerDisplayPreferences.http
new file mode 100644
index 00000000..99e15c76
--- /dev/null
+++ b/docs/technical/requests/scheduling/GetSchedulerDisplayPreferences.http
@@ -0,0 +1,2 @@
+GET {{host}}/api/v1/scheduled-jobs/display-preferences
+Authorization: Bearer {{ACCESS_TOKEN}}
diff --git a/docs/technical/requests/scheduling/UpdateSchedulerDisplayPreferences.http b/docs/technical/requests/scheduling/UpdateSchedulerDisplayPreferences.http
new file mode 100644
index 00000000..16d64d14
--- /dev/null
+++ b/docs/technical/requests/scheduling/UpdateSchedulerDisplayPreferences.http
@@ -0,0 +1,9 @@
+PUT {{host}}/api/v1/scheduled-jobs/display-preferences
+Authorization: Bearer {{ACCESS_TOKEN}}
+Content-Type: application/json
+
+{
+ "jobTypeFilter": "ScanMediaLibraries",
+ "displayTimeSpan": 10,
+ "displayTimeUnit": "Minutes"
+}
diff --git a/src/Lumina.Application/Common/DataAccess/Entities/Scheduling/SchedulerDisplayPreferencesEntity.cs b/src/Lumina.Application/Common/DataAccess/Entities/Scheduling/SchedulerDisplayPreferencesEntity.cs
new file mode 100644
index 00000000..7cdfea0d
--- /dev/null
+++ b/src/Lumina.Application/Common/DataAccess/Entities/Scheduling/SchedulerDisplayPreferencesEntity.cs
@@ -0,0 +1,60 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.DataAccess.Entities.Common;
+using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
+using System;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Application.Common.DataAccess.Entities.Scheduling;
+
+///
+/// Repository entity for the display preferences of the scheduler page of a user.
+///
+[DebuggerDisplay("UserId: {UserId}, DisplayTimeSpan: {DisplayTimeSpan}")]
+public class SchedulerDisplayPreferencesEntity : IStorageEntity, IAuditableEntity
+{
+ ///
+ /// Gets or sets the Id of the display preferences.
+ ///
+ public required Guid Id { get; init; }
+
+ ///
+ /// Gets or sets the Id of the user that owns the display preferences.
+ ///
+ public required Guid UserId { get; set; }
+
+ ///
+ /// Gets or sets the type of the scheduled job tasks whose executions are shown on the scheduler page, or when all of them are shown.
+ ///
+ public ScheduledTaskType? JobTypeFilter { get; set; }
+
+ ///
+ /// Gets or sets the time span, expressed in , that the scheduler page shows.
+ ///
+ public required int DisplayTimeSpan { get; set; }
+
+ ///
+ /// Gets or sets the unit in which the displayed time span of the scheduler page is expressed.
+ ///
+ public required SchedulerDisplayTimeUnit DisplayTimeUnit { get; set; }
+
+ ///
+ /// Gets or sets the time and date when the entity was added.
+ ///
+ public required DateTime CreatedOnUtc { get; set; }
+
+ ///
+ /// Gets or sets the Id of the user that created the entity.
+ ///
+ public required Guid CreatedBy { get; set; }
+
+ ///
+ /// Gets or sets the optional time and date when the entity was updated.
+ ///
+ public DateTime? UpdatedOnUtc { get; set; }
+
+ ///
+ /// Gets or sets the optional Id of the user that updated the entity.
+ ///
+ public required Guid? UpdatedBy { get; set; }
+}
diff --git a/src/Lumina.Application/Common/DataAccess/Repositories/Scheduling/ISchedulerDisplayPreferencesRepository.cs b/src/Lumina.Application/Common/DataAccess/Repositories/Scheduling/ISchedulerDisplayPreferencesRepository.cs
new file mode 100644
index 00000000..c574e898
--- /dev/null
+++ b/src/Lumina.Application/Common/DataAccess/Repositories/Scheduling/ISchedulerDisplayPreferencesRepository.cs
@@ -0,0 +1,32 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.DataAccess.Entities.Scheduling;
+using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
+using Lumina.Domain.Common.Primitives;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+#endregion
+
+namespace Lumina.Application.Common.DataAccess.Repositories.Scheduling;
+
+///
+/// Interface for the repository for the display preferences of the scheduler page.
+///
+public interface ISchedulerDisplayPreferencesRepository : IRepository
+{
+ ///
+ /// Gets the display preferences of the scheduler page of the user identified by , if they exist.
+ ///
+ /// The Id of the user whose display preferences are retrieved.
+ /// Cancellation token that can be used to stop the execution.
+ /// An containing either the display preferences of the user, or an error.
+ Task> GetByUserIdAsync(Guid userId, CancellationToken cancellationToken);
+
+ ///
+ /// Inserts the display preferences of the scheduler page of a user, or updates them when they already exist.
+ ///
+ /// The display preferences to insert or update.
+ /// Cancellation token that can be used to stop the execution.
+ /// An representing either a successful operation, or an error.
+ Task> UpsertAsync(SchedulerDisplayPreferencesEntity preferences, CancellationToken cancellationToken);
+}
diff --git a/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs b/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs
index 8a84bce4..9c4c7407 100644
--- a/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs
+++ b/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs
@@ -98,6 +98,11 @@ public interface IUnitOfWork
///
IScheduledJobExecutionRepository ScheduledJobExecutionRepository { get; }
+ ///
+ /// Gets the scheduler display preferences repository.
+ ///
+ ISchedulerDisplayPreferencesRepository SchedulerDisplayPreferencesRepository { get; }
+
///
/// Gets the plugin repository.
///
diff --git a/src/Lumina.Application/Common/Mapping/Scheduling/SchedulerDisplayPreferencesEntityMapping.cs b/src/Lumina.Application/Common/Mapping/Scheduling/SchedulerDisplayPreferencesEntityMapping.cs
new file mode 100644
index 00000000..0e01d898
--- /dev/null
+++ b/src/Lumina.Application/Common/Mapping/Scheduling/SchedulerDisplayPreferencesEntityMapping.cs
@@ -0,0 +1,48 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.DataAccess.Entities.Scheduling;
+using Lumina.Contracts.Responses.Scheduling;
+using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
+using System;
+#endregion
+
+namespace Lumina.Application.Common.Mapping.Scheduling;
+
+///
+/// Extension methods for converting .
+///
+public static class SchedulerDisplayPreferencesEntityMapping
+{
+ private const int DEFAULT_DISPLAY_TIME_SPAN = 10;
+ private const SchedulerDisplayTimeUnit DEFAULT_DISPLAY_TIME_UNIT = SchedulerDisplayTimeUnit.Minutes;
+
+ ///
+ /// Converts to .
+ ///
+ /// The repository entity to be converted.
+ /// The converted response.
+ public static SchedulerDisplayPreferencesResponse ToResponse(this SchedulerDisplayPreferencesEntity repositoryEntity)
+ {
+ return new SchedulerDisplayPreferencesResponse(
+ repositoryEntity.UserId,
+ repositoryEntity.JobTypeFilter,
+ repositoryEntity.DisplayTimeSpan,
+ repositoryEntity.DisplayTimeUnit
+ );
+ }
+
+ ///
+ /// Converts the lack of stored display preferences to the default of the user identified by .
+ ///
+ /// The missing repository entity, which is .
+ /// The Id of the user that owns the display preferences.
+ /// The converted response with the default display preferences.
+ public static SchedulerDisplayPreferencesResponse ToDefaultResponse(this SchedulerDisplayPreferencesEntity? repositoryEntity, Guid userId)
+ {
+ return new SchedulerDisplayPreferencesResponse(
+ userId,
+ null,
+ DEFAULT_DISPLAY_TIME_SPAN,
+ DEFAULT_DISPLAY_TIME_UNIT
+ );
+ }
+}
diff --git a/src/Lumina.Application/Common/Mapping/Scheduling/UpdateSchedulerDisplayPreferencesRequestMapping.cs b/src/Lumina.Application/Common/Mapping/Scheduling/UpdateSchedulerDisplayPreferencesRequestMapping.cs
new file mode 100644
index 00000000..f0e74408
--- /dev/null
+++ b/src/Lumina.Application/Common/Mapping/Scheduling/UpdateSchedulerDisplayPreferencesRequestMapping.cs
@@ -0,0 +1,26 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
+using Lumina.Contracts.Requests.Scheduling;
+#endregion
+
+namespace Lumina.Application.Common.Mapping.Scheduling;
+
+///
+/// Extension methods for converting .
+///
+public static class UpdateSchedulerDisplayPreferencesRequestMapping
+{
+ ///
+ /// Converts to .
+ ///
+ /// The request to be converted.
+ /// The converted command.
+ public static UpdateSchedulerDisplayPreferencesCommand ToCommand(this UpdateSchedulerDisplayPreferencesRequest request)
+ {
+ return new UpdateSchedulerDisplayPreferencesCommand(
+ request.JobTypeFilter,
+ request.DisplayTimeSpan,
+ request.DisplayTimeUnit
+ );
+ }
+}
diff --git a/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommand.cs b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommand.cs
new file mode 100644
index 00000000..2115f817
--- /dev/null
+++ b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommand.cs
@@ -0,0 +1,20 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.CQRS;
+using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Application.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
+
+///
+/// Command for updating the display preferences of the scheduler page of the current user.
+///
+/// The type of the scheduled job tasks whose executions are shown on the scheduler page, or when all of them are shown.
+/// The time span, expressed in , that the scheduler page shows.
+/// The unit in which the displayed time span of the scheduler page is expressed.
+[DebuggerDisplay("DisplayTimeSpan: {DisplayTimeSpan} {DisplayTimeUnit}")]
+public record UpdateSchedulerDisplayPreferencesCommand(
+ ScheduledTaskType? JobTypeFilter,
+ int DisplayTimeSpan,
+ SchedulerDisplayTimeUnit DisplayTimeUnit
+) : ICommand;
diff --git a/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandHandler.cs b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandHandler.cs
new file mode 100644
index 00000000..54c6fa4b
--- /dev/null
+++ b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandHandler.cs
@@ -0,0 +1,86 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.CQRS;
+using Lumina.Application.Common.DataAccess.Entities.Scheduling;
+using Lumina.Application.Common.DataAccess.UoW;
+using Lumina.Application.Common.Infrastructure.Authentication;
+using Lumina.Application.Common.Infrastructure.Authorization;
+using Lumina.Application.Common.Infrastructure.Validation;
+using Lumina.Domain.Common.Primitives;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
+#endregion
+
+namespace Lumina.Application.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
+
+///
+/// Handler for the command to update the display preferences of the scheduler page of the current user.
+///
+public class UpdateSchedulerDisplayPreferencesCommandHandler : ICommandHandler>
+{
+ private readonly ICurrentUserService _currentUserService;
+ private readonly IAuthorizationService _authorizationService;
+ private readonly IUnitOfWork _unitOfWork;
+ private readonly IValidator _validator;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for authorization related functionality.
+ /// Injected service to retrieve the current user information.
+ /// Injected unit of work for interacting with the data access layer repositories.
+ /// Injected validator for application validation rules.
+ public UpdateSchedulerDisplayPreferencesCommandHandler(IAuthorizationService authorizationService, ICurrentUserService currentUserService, IUnitOfWork unitOfWork, IValidator validator)
+ {
+ _authorizationService = authorizationService;
+ _currentUserService = currentUserService;
+ _unitOfWork = unitOfWork;
+ _validator = validator;
+ }
+
+ ///
+ /// Handles the command to update the display preferences of the scheduler page of the current user.
+ ///
+ /// The command to be handled.
+ /// Cancellation token that can be used to stop the execution.
+ ///
+ /// An representing either a successful update, or an error.
+ ///
+ public async Task> HandleAsync(UpdateSchedulerDisplayPreferencesCommand command, CancellationToken cancellationToken)
+ {
+ List validationResult = _validator.Validate(command);
+ if (validationResult.Count > 0)
+ return validationResult;
+
+ // An authenticated request must always carry a user identity.
+ Guid? currentUserId = _currentUserService.UserId;
+ if (currentUserId is null)
+ return ApplicationErrors.Authorization.NotAuthorized;
+ Guid userId = currentUserId.Value;
+
+ // Only administrators can use the scheduler page.
+ if (!await _authorizationService.IsInRoleAsync(userId, "Admin", cancellationToken).ConfigureAwait(false))
+ return ApplicationErrors.Authorization.NotAuthorized;
+
+ // Upsert the display preferences of the scheduler page of the current user.
+ SchedulerDisplayPreferencesEntity displayPreferences = new()
+ {
+ Id = Guid.NewGuid(),
+ UserId = userId,
+ JobTypeFilter = command.JobTypeFilter,
+ DisplayTimeSpan = command.DisplayTimeSpan,
+ DisplayTimeUnit = command.DisplayTimeUnit,
+ CreatedOnUtc = default,
+ CreatedBy = default,
+ UpdatedOnUtc = null,
+ UpdatedBy = null
+ };
+ Result upsertResult = await _unitOfWork.SchedulerDisplayPreferencesRepository.UpsertAsync(displayPreferences, cancellationToken).ConfigureAwait(false);
+ if (upsertResult.IsFailure)
+ return upsertResult.Errors;
+ await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
+ return Result.Updated;
+ }
+}
diff --git a/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandValidator.cs b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandValidator.cs
new file mode 100644
index 00000000..6dea97e1
--- /dev/null
+++ b/src/Lumina.Application/Core/Scheduling/Commands/UpdateSchedulerDisplayPreferences/UpdateSchedulerDisplayPreferencesCommandValidator.cs
@@ -0,0 +1,23 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.Infrastructure.Validation;
+using Lumina.Application.Common.Utilities;
+using Lumina.Domain.Common.Errors;
+#endregion
+
+namespace Lumina.Application.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
+
+///
+/// Validates the needed validation rules for .
+///
+public class UpdateSchedulerDisplayPreferencesCommandValidator : AbstractValidator
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UpdateSchedulerDisplayPreferencesCommandValidator()
+ {
+ RuleFor(command => command.DisplayTimeSpan)
+ .GreaterThan(0)
+ .WithError(Errors.Scheduling.SchedulerDisplayTimeSpanMustBePositive);
+ }
+}
diff --git a/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQuery.cs b/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQuery.cs
new file mode 100644
index 00000000..6f12960a
--- /dev/null
+++ b/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQuery.cs
@@ -0,0 +1,10 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.CQRS;
+#endregion
+
+namespace Lumina.Application.Core.Scheduling.Queries.GetSchedulerDisplayPreferences;
+
+///
+/// Query for getting the display preferences of the scheduler page of the current user.
+///
+public record GetSchedulerDisplayPreferencesQuery : IQuery;
diff --git a/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQueryHandler.cs b/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQueryHandler.cs
new file mode 100644
index 00000000..eeaaff89
--- /dev/null
+++ b/src/Lumina.Application/Core/Scheduling/Queries/GetSchedulerDisplayPreferences/GetSchedulerDisplayPreferencesQueryHandler.cs
@@ -0,0 +1,72 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.CQRS;
+using Lumina.Application.Common.DataAccess.Entities.Scheduling;
+using Lumina.Application.Common.DataAccess.UoW;
+using Lumina.Application.Common.Errors;
+using Lumina.Application.Common.Infrastructure.Authentication;
+using Lumina.Application.Common.Infrastructure.Authorization;
+using Lumina.Application.Common.Mapping.Scheduling;
+using Lumina.Contracts.Responses.Scheduling;
+using Lumina.Domain.Common.Primitives;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
+#endregion
+
+namespace Lumina.Application.Core.Scheduling.Queries.GetSchedulerDisplayPreferences;
+
+///
+/// Handler for the query to get the display preferences of the scheduler page of the current user.
+///
+public class GetSchedulerDisplayPreferencesQueryHandler : IQueryHandler>
+{
+ private readonly ICurrentUserService _currentUserService;
+ private readonly IAuthorizationService _authorizationService;
+ private readonly IUnitOfWork _unitOfWork;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for authorization related functionality.
+ /// Injected service to retrieve the current user information.
+ /// Injected unit of work for interacting with the data access layer repositories.
+ public GetSchedulerDisplayPreferencesQueryHandler(IAuthorizationService authorizationService, ICurrentUserService currentUserService, IUnitOfWork unitOfWork)
+ {
+ _authorizationService = authorizationService;
+ _currentUserService = currentUserService;
+ _unitOfWork = unitOfWork;
+ }
+
+ ///
+ /// Handles the query to get the display preferences of the scheduler page of the current user.
+ ///
+ /// The query to be handled.
+ /// Cancellation token that can be used to stop the execution.
+ ///
+ /// An containing either the display preferences of the scheduler page of the current user, or an error.
+ ///
+ public async Task> HandleAsync(GetSchedulerDisplayPreferencesQuery query, CancellationToken cancellationToken)
+ {
+ // An authenticated request must always carry a user identity.
+ Guid? currentUserId = _currentUserService.UserId;
+ if (currentUserId is null)
+ return ApplicationErrors.Authorization.NotAuthorized;
+ Guid userId = currentUserId.Value;
+
+ // Only administrators can view the scheduler page.
+ if (!await _authorizationService.IsInRoleAsync(userId, "Admin", cancellationToken).ConfigureAwait(false))
+ return ApplicationErrors.Authorization.NotAuthorized;
+
+ // Get the display preferences of the scheduler page of the current user from the repository.
+ Result getDisplayPreferencesResult = await _unitOfWork.SchedulerDisplayPreferencesRepository.GetByUserIdAsync(userId, cancellationToken).ConfigureAwait(false);
+ if (getDisplayPreferencesResult.IsFailure)
+ return getDisplayPreferencesResult.Errors;
+
+ // When no display preferences are stored for the current user yet, return the default display preferences.
+ if (getDisplayPreferencesResult.Value is null)
+ return getDisplayPreferencesResult.Value.ToDefaultResponse(userId);
+
+ return getDisplayPreferencesResult.Value.ToResponse();
+ }
+}
diff --git a/src/Lumina.Contracts/Requests/Scheduling/UpdateSchedulerDisplayPreferencesRequest.cs b/src/Lumina.Contracts/Requests/Scheduling/UpdateSchedulerDisplayPreferencesRequest.cs
new file mode 100644
index 00000000..ff546221
--- /dev/null
+++ b/src/Lumina.Contracts/Requests/Scheduling/UpdateSchedulerDisplayPreferencesRequest.cs
@@ -0,0 +1,19 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Requests.Scheduling;
+
+///
+/// Represents a request to update the display preferences of the scheduler page of the current user.
+///
+/// The type of the scheduled job tasks whose executions are shown on the scheduler page, or when all of them are shown.
+/// The time span, expressed in , that the scheduler page shows. Required.
+/// The unit in which the displayed time span of the scheduler page is expressed. Required.
+[DebuggerDisplay("DisplayTimeSpan: {DisplayTimeSpan} {DisplayTimeUnit}")]
+public sealed record UpdateSchedulerDisplayPreferencesRequest(
+ ScheduledTaskType? JobTypeFilter,
+ int DisplayTimeSpan,
+ SchedulerDisplayTimeUnit DisplayTimeUnit
+);
diff --git a/src/Lumina.Contracts/Responses/Scheduling/SchedulerDisplayPreferencesResponse.cs b/src/Lumina.Contracts/Responses/Scheduling/SchedulerDisplayPreferencesResponse.cs
new file mode 100644
index 00000000..d762eccf
--- /dev/null
+++ b/src/Lumina.Contracts/Responses/Scheduling/SchedulerDisplayPreferencesResponse.cs
@@ -0,0 +1,22 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
+using System;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.Scheduling;
+
+///
+/// Represents the display preferences of the scheduler page of a user.
+///
+/// The unique identifier of the user that owns the display preferences.
+/// The type of the scheduled job tasks whose executions are shown on the scheduler page, or when all of them are shown.
+/// The time span, expressed in , that the scheduler page shows.
+/// The unit in which the displayed time span of the scheduler page is expressed.
+[DebuggerDisplay("UserId: {UserId}, DisplayTimeSpan: {DisplayTimeSpan} {DisplayTimeUnit}")]
+public sealed record SchedulerDisplayPreferencesResponse(
+ Guid UserId,
+ ScheduledTaskType? JobTypeFilter,
+ int DisplayTimeSpan,
+ SchedulerDisplayTimeUnit DisplayTimeUnit
+);
diff --git a/src/Lumina.DataAccess/Common/Configuration/SchedulerDisplayPreferencesConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/SchedulerDisplayPreferencesConfiguration.cs
new file mode 100644
index 00000000..698aaac7
--- /dev/null
+++ b/src/Lumina.DataAccess/Common/Configuration/SchedulerDisplayPreferencesConfiguration.cs
@@ -0,0 +1,65 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Common.DataAccess.Entities.Scheduling;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using System;
+#endregion
+
+namespace Lumina.DataAccess.Common.Configuration;
+
+///
+/// Configures the entity mapping for the entity.
+///
+public class SchedulerDisplayPreferencesConfiguration : IEntityTypeConfiguration
+{
+ ///
+ /// Configures the entity.
+ ///
+ /// The builder to be used to configure the entity.
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.ToTable("SchedulerDisplayPreferences");
+ builder.HasKey(preferences => preferences.Id);
+ builder.Property(preferences => preferences.Id)
+ .ValueGeneratedNever() // because EF always tries to generate the value for the Id, and because we generate it as part of the aggregate root, we need to tell EF not to generate it
+ .HasColumnOrder(0);
+
+ builder.Property(preferences => preferences.UserId)
+ .IsRequired()
+ .HasColumnOrder(1);
+
+ builder.Property(preferences => preferences.JobTypeFilter)
+ .HasConversion()
+ .HasColumnOrder(2);
+
+ builder.Property(preferences => preferences.DisplayTimeSpan)
+ .IsRequired()
+ .HasColumnOrder(3);
+
+ builder.Property(preferences => preferences.DisplayTimeUnit)
+ .IsRequired()
+ .HasConversion()
+ .HasColumnOrder(4);
+
+ // Audit.
+ builder.Property(preferences => preferences.CreatedOnUtc)
+ .IsRequired()
+ .HasColumnOrder(5);
+
+ builder.Property(preferences => preferences.CreatedBy)
+ .IsRequired()
+ .HasColumnOrder(6);
+
+ builder.Property(preferences => preferences.UpdatedOnUtc)
+ .HasDefaultValue(null)
+ .HasColumnOrder(7);
+
+ builder.Property(preferences => preferences.UpdatedBy)
+ .HasDefaultValue(null)
+ .HasColumnOrder(8);
+
+ // One user has at most one set of scheduler page display preferences.
+ builder.HasIndex(preferences => preferences.UserId)
+ .IsUnique();
+ }
+}
diff --git a/src/Lumina.DataAccess/Common/Migrations/20260903201036_AddsSchedulerDisplayPreferences.Designer.cs b/src/Lumina.DataAccess/Common/Migrations/20260903201036_AddsSchedulerDisplayPreferences.Designer.cs
new file mode 100644
index 00000000..e11987b7
--- /dev/null
+++ b/src/Lumina.DataAccess/Common/Migrations/20260903201036_AddsSchedulerDisplayPreferences.Designer.cs
@@ -0,0 +1,1788 @@
+//
+using System;
+using Lumina.DataAccess.Core.UoW;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Lumina.DataAccess.Common.Migrations
+{
+ [DbContext(typeof(LuminaDbContext))]
+ [Migration("20260903201036_AddsSchedulerDisplayPreferences")]
+ partial class AddsSchedulerDisplayPreferences
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "10.0.11");
+
+ modelBuilder.Entity("BookGenres", b =>
+ {
+ b.Property("BookId")
+ .HasColumnType("TEXT");
+
+ b.Property("GenreId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("BookId", "GenreId");
+
+ b.HasIndex("GenreId");
+
+ b.ToTable("BookGenres", (string)null);
+ });
+
+ modelBuilder.Entity("BookTags", b =>
+ {
+ b.Property("BookId")
+ .HasColumnType("TEXT");
+
+ b.Property("TagId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("BookId", "TagId");
+
+ b.HasIndex("TagId");
+
+ b.ToTable("BookTags", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("PermissionName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.HasKey("Id");
+
+ b.ToTable("Permissions", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.HasKey("Id");
+
+ b.ToTable("Roles", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b =>
+ {
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.Property("PermissionId")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.HasKey("RoleId", "PermissionId");
+
+ b.HasIndex("PermissionId");
+
+ b.HasIndex("RoleId", "PermissionId")
+ .IsUnique();
+
+ b.ToTable("RolePermissions", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("PermissionId")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.HasKey("UserId", "PermissionId");
+
+ b.HasIndex("PermissionId");
+
+ b.HasIndex("UserId", "PermissionId")
+ .IsUnique();
+
+ b.ToTable("UserPermissions", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.HasKey("UserId");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("UserId", "RoleId")
+ .IsUnique();
+
+ b.ToTable("UserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", b =>
+ {
+ b.Property("Name")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Name");
+
+ b.ToTable("Genres", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", b =>
+ {
+ b.Property("Name")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Name");
+
+ b.ToTable("Tags", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.BookContributorEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("BookId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("MediaContributorId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("RoleCategory")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.HasKey("Id");
+
+ b.HasIndex("MediaContributorId");
+
+ b.HasIndex("BookId", "MediaContributorId");
+
+ b.ToTable("BookContributors", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.MediaContributorEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("Biography")
+ .HasMaxLength(2000)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("DateOfBirth")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("DateOfDeath")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1)
+ .UseCollation("NOCASE");
+
+ b.Property("LegalName")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisplayName")
+ .IsUnique();
+
+ b.ToTable("MediaContributors", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b =>
+ {
+ b.Property("LibraryId")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasMaxLength(1024)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("LastWriteTimeUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.HasKey("LibraryId", "Path");
+
+ b.HasIndex("LibraryId");
+
+ b.ToTable("DirectoryScanFingerprints", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("ArtworkProvidersConfigurationFingerprint")
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(10);
+
+ b.Property("CanDownloadMetadataFromWeb")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER")
+ .HasDefaultValue(true)
+ .HasColumnOrder(6);
+
+ b.Property("CoverImage")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(12);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.Property("IsEnabled")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER")
+ .HasDefaultValue(true)
+ .HasColumnOrder(4);
+
+ b.Property("IsLocked")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(5);
+
+ b.Property("LibraryType")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("MetadataProvidersConfigurationFingerprint")
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("ShouldSaveMetadataInMediaDirectories")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(7);
+
+ b.Property("ShouldSkipUnchangedDirectoriesDuringScan")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(8);
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(14);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(13);
+
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Libraries", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex("LibraryId", "Status", "CreatedOnUtc")
+ .IsDescending(true, false, true);
+
+ b.ToTable("LibraryScans", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b =>
+ {
+ b.Property("LibraryScanId")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasMaxLength(1024)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("ContentHash")
+ .HasMaxLength(24)
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(2);
+
+ b.Property("FileSize")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("Ticks")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.HasKey("LibraryScanId", "Path");
+
+ b.HasIndex("Path");
+
+ b.HasIndex("ContentHash", "FileSize", "Path");
+
+ b.ToTable("LibraryScanResults", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b =>
+ {
+ b.Property("LibraryId")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasMaxLength(1024)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("ContentHash")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(2);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("FileSize")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("Ticks")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.HasKey("LibraryId", "Path");
+
+ b.HasIndex("LibraryId");
+
+ b.ToTable("LibraryScanSnapshots", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b =>
+ {
+ b.Property("LibraryScanId")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasMaxLength(1024)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("ContentHash")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("IsNew")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(7);
+
+ b.Property("NeedsRehash")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(6);
+
+ b.Property("PreviousContentHash")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(5);
+
+ b.Property("Size")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(2);
+
+ b.Property("Ticks")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.HasKey("LibraryScanId", "Path");
+
+ b.HasIndex("LibraryScanId", "NeedsRehash");
+
+ b.ToTable("LibraryScanStagingResults", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookArtworkEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("ArtworkType")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("BookId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("ContentHash")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(5);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(10);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("FileName")
+ .HasMaxLength(2048)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("LastUpdateUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("Ordinal")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("Provider")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(12);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Status");
+
+ b.HasIndex("BookId", "ArtworkType", "Ordinal")
+ .IsUnique();
+
+ b.ToTable("BookArtwork", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("ASIN")
+ .HasMaxLength(10)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(21);
+
+ b.Property("AppleBooksId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(29);
+
+ b.Property("BarnesAndNobleId")
+ .HasMaxLength(10)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(28);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(33);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(32);
+
+ b.Property("Description")
+ .HasMaxLength(2000)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("Edition")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(19);
+
+ b.Property("Format")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(18);
+
+ b.Property("GoodreadsId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(22);
+
+ b.Property("GoogleBooksId")
+ .HasMaxLength(12)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(27);
+
+ b.Property("LCCN")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(23);
+
+ b.Property("LanguageCode")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(10);
+
+ b.Property("LanguageName")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.Property("LanguageNativeName")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(12);
+
+ b.Property("LastMetadataUpdateUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(39);
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(36);
+
+ b.Property("LibraryThingId")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(26);
+
+ b.Property("MetadataProvider")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(40);
+
+ b.Property("MetadataStatus")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(38);
+
+ b.Property("OCLCNumber")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(24);
+
+ b.Property("OpenLibraryId")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(25);
+
+ b.Property("OriginalLanguageCode")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(13);
+
+ b.Property("OriginalLanguageName")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(14);
+
+ b.Property("OriginalLanguageNativeName")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(15);
+
+ b.Property("OriginalReleaseDate")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("OriginalReleaseYear")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(5);
+
+ b.Property("OriginalTitle")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("PageCount")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(17);
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(2048)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(37);
+
+ b.Property("Publisher")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(16);
+
+ b.Property("ReReleaseDate")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("ReReleaseYear")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(7);
+
+ b.Property("ReleaseCountry")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("ReleaseVersion")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(35);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(34);
+
+ b.Property("VolumeNumber")
+ .HasColumnType("REAL")
+ .HasColumnOrder(20);
+
+ b.HasKey("Id");
+
+ b.HasIndex("LibraryId", "MetadataStatus");
+
+ b.HasIndex("LibraryId", "Path");
+
+ b.ToTable("Books", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryArtworkProviderConfigurationEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("IsEnabled")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("PluginId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("Rank")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.HasKey("Id");
+
+ b.HasIndex("LibraryId", "PluginId");
+
+ b.ToTable("LibraryArtworkProviderConfigurations", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryBookReaderConfigurationEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("IsEnabled")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("PluginId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.HasKey("Id");
+
+ b.HasIndex("LibraryId", "PluginId")
+ .IsUnique();
+
+ b.ToTable("LibraryBookReaderConfigurations", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryMetadataProviderConfigurationEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("IsEnabled")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("PluginId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("Rank")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.HasKey("Id");
+
+ b.HasIndex("LibraryId", "PluginId");
+
+ b.ToTable("LibraryMetadataProviderConfigurations", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.PluginEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("Author")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("LoadError")
+ .HasMaxLength(2000)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("LoadStatus")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("SettingsJson")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(10);
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.HasKey("Id");
+
+ b.ToTable("Plugins", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(12);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.Property("Hour")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(5);
+
+ b.Property("IntervalMinutes")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(4);
+
+ b.Property("LastCompletedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(10);
+
+ b.Property("LastStartedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("Minute")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(6);
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("OwnerUserId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("ScheduleType")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(3);
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("TaskType")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(14);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(13);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Status");
+
+ b.ToTable("ScheduledJobs", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobExecutionEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CompletedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("IsCycleRun")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("ScheduledJobId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.Property("StartedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("TaskType")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(9);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.HasKey("Id");
+
+ b.HasIndex("ScheduledJobId");
+
+ b.HasIndex("StartedOnUtc", "ScheduledJobId");
+
+ b.ToTable("ScheduledJobExecutions", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.SchedulerDisplayPreferencesEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(6);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(5);
+
+ b.Property("DisplayTimeSpan")
+ .HasColumnType("INTEGER")
+ .HasColumnOrder(3);
+
+ b.Property("DisplayTimeUnit")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("JobTypeFilter")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(2);
+
+ b.Property("UpdatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(8);
+
+ b.Property("UpdatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(7);
+
+ b.Property("UserId")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(1);
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId")
+ .IsUnique();
+
+ b.ToTable("SchedulerDisplayPreferences", (string)null);
+ });
+
+ modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Themes.ThemeEntity", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(0);
+
+ b.Property("Author")
+ .IsRequired()
+ .HasMaxLength(80)
+ .HasColumnType("TEXT")
+ .HasColumnOrder(4);
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(12);
+
+ b.Property("CreatedOnUtc")
+ .HasColumnType("TEXT")
+ .HasColumnOrder(11);
+
+ b.Property