From 9c2e5452da912aa0191213a08423d21ea51b1675 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sun, 9 Aug 2026 12:59:22 -0700 Subject: [PATCH] Adds the opt-in directory fast skip scan setting and renames the library scan settings for consistency --- .../MediaLibrary/Management/LibraryEntity.cs | 9 +- .../AddMediaLibraryRequestMapping.cs | 5 +- .../Management/LibraryEntityMapping.cs | 12 +- .../MediaLibrary/Management/LibraryMapping.cs | 5 +- .../Management/UpdateLibraryRequestMapping.cs | 5 +- .../Commands/AddLibrary/AddLibraryCommand.cs | 10 +- .../AddLibrary/AddLibraryCommandHandler.cs | 7 +- .../UpdateLibrary/UpdateLibraryCommand.cs | 10 +- .../UpdateLibraryCommandHandler.cs | 7 +- .../LibraryScanQueuedDomainEventHandler.cs | 2 +- .../Management/AddLibraryRequest.cs | 10 +- .../Management/UpdateLibraryRequest.cs | 10 +- .../Management/LibraryResponse.cs | 5 +- .../Configuration/LibraryConfiguration.cs | 15 +- ...amesLibraryScanSettingsColumns.Designer.cs | 1019 +++++++++++++++++ ...90243_RenamesLibraryScanSettingsColumns.cs | 48 + .../LibraryAggregate/Library.cs | 59 +- .../AddLibrary/AddLibraryEndpointSummary.cs | 22 +- .../GetEnabledLibrariesEndpointSummary.cs | 10 +- .../GetLibrariesEndpointSummary.cs | 10 +- .../GetLibrary/GetLibraryEndpointSummary.cs | 10 +- .../UpdateLibraryEndpointSummary.cs | 22 +- .../Common/Models/Libraries/LibraryModel.cs | 10 +- .../Views/Library/Management/Item.Designer.cs | 10 +- .../Views/Library/Management/Item.de-DE.resx | 10 +- .../Views/Library/Management/Item.en-US.resx | 10 +- .../Views/Library/Management/Item.es-ES.resx | 10 +- .../Views/Library/Management/Item.fr-FR.resx | 10 +- .../Views/Library/Management/Item.it-IT.resx | 10 +- .../Views/Library/Management/Item.ja-JP.resx | 10 +- .../Views/Library/Management/Item.resx | 10 +- .../Views/Library/Management/Item.ro-RO.resx | 10 +- .../Views/Library/Management/Item.ru-RU.resx | 10 +- .../Views/Library/Management/Item.zh-CN.resx | 10 +- .../Views/Library/Management/Item.cshtml | 32 +- .../AddMediaLibraryRequestMappingTests.cs | 12 +- .../Management/LibraryMappingTests.cs | 14 +- .../Fixtures/DomainLibraryFixture.cs | 16 +- 38 files changed, 1360 insertions(+), 146 deletions(-) create mode 100644 src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.Designer.cs create mode 100644 src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.cs diff --git a/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/Management/LibraryEntity.cs b/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/Management/LibraryEntity.cs index 080dc156..92edd6ec 100644 --- a/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/Management/LibraryEntity.cs +++ b/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/Management/LibraryEntity.cs @@ -63,12 +63,17 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity /// /// Gets whether this media library should update the metadata of its elements from the web, or not. /// - public bool DownloadMedatadaFromWeb { get; init; } + public bool DownloadMetadataFromWeb { get; init; } /// /// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not. /// - public bool SaveMetadataInMediaDirectories { get; init; } + public bool ShouldSaveMetadataInMediaDirectories { get; init; } + + /// + /// Gets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan. + /// + public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; } /// /// Gets the user that owns the media library. diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMapping.cs index deda7756..75673944 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMapping.cs @@ -27,8 +27,9 @@ public static class AddMediaLibraryRequestMapping request.CoverImage, request.IsEnabled, request.IsLocked, - request.DownloadMedatadaFromWeb, - request.SaveMetadataInMediaDirectories + request.DownloadMetadataFromWeb, + request.ShouldSaveMetadataInMediaDirectories, + request.ShouldSkipUnchangedDirectoriesDuringScan ); } } diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryEntityMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryEntityMapping.cs index 92c979af..08598ec3 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryEntityMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryEntityMapping.cs @@ -33,8 +33,9 @@ public static class LibraryEntityMapping repositoryEntity.CoverImage, repositoryEntity.IsEnabled, repositoryEntity.IsLocked, - repositoryEntity.DownloadMedatadaFromWeb, - repositoryEntity.SaveMetadataInMediaDirectories, + repositoryEntity.DownloadMetadataFromWeb, + repositoryEntity.ShouldSaveMetadataInMediaDirectories, + repositoryEntity.ShouldSkipUnchangedDirectoriesDuringScan, repositoryEntity.CreatedOnUtc, repositoryEntity.UpdatedOnUtc ); @@ -45,7 +46,7 @@ public static class LibraryEntityMapping /// /// The repository entity to be converted. /// - /// An containing either a successfuly converted , or an error message. + /// An containing either a successfully converted , or an error message. /// public static ErrorOr ToDomainEntity(this LibraryEntity repositoryEntity) { @@ -58,8 +59,9 @@ public static class LibraryEntityMapping repositoryEntity.CoverImage, repositoryEntity.IsEnabled, repositoryEntity.IsLocked, - repositoryEntity.DownloadMedatadaFromWeb, - repositoryEntity.SaveMetadataInMediaDirectories, + repositoryEntity.DownloadMetadataFromWeb, + repositoryEntity.ShouldSaveMetadataInMediaDirectories, + repositoryEntity.ShouldSkipUnchangedDirectoriesDuringScan, repositoryEntity.LibraryScans.Select(libraryScan => ScanId.Create(libraryScan.Id)).ToList() ); } diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryMapping.cs index 75f59244..dac14f8a 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/LibraryMapping.cs @@ -29,8 +29,9 @@ public static class LibraryMapping CoverImage = domainEntity.CoverImage, IsEnabled = domainEntity.IsEnabled, IsLocked = domainEntity.IsLocked, - DownloadMedatadaFromWeb = domainEntity.DownloadMedatadaFromWeb, - SaveMetadataInMediaDirectories = domainEntity.SaveMetadataInMediaDirectories, + DownloadMetadataFromWeb = domainEntity.DownloadMetadataFromWeb, + ShouldSaveMetadataInMediaDirectories = domainEntity.ShouldSaveMetadataInMediaDirectories, + ShouldSkipUnchangedDirectoriesDuringScan = domainEntity.ShouldSkipUnchangedDirectoriesDuringScan, LibraryScans = domainEntity.ScanIds.Select(scanId => new LibraryScanEntity() { Id = scanId.Value, diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/UpdateLibraryRequestMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/UpdateLibraryRequestMapping.cs index 6275c61c..c0dfc446 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/UpdateLibraryRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/Management/UpdateLibraryRequestMapping.cs @@ -27,8 +27,9 @@ public static class UpdateLibraryRequestMapping request.CoverImage, request.IsEnabled, request.IsLocked, - request.DownloadMedatadaFromWeb, - request.SaveMetadataInMediaDirectories + request.DownloadMetadataFromWeb, + request.ShouldSaveMetadataInMediaDirectories, + request.ShouldSkipUnchangedDirectoriesDuringScan ); } } diff --git a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommand.cs b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommand.cs index 466ed364..d520d53a 100644 --- a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommand.cs +++ b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommand.cs @@ -17,8 +17,9 @@ namespace Lumina.Application.Core.MediaLibrary.Management.Commands.AddLibrary; /// The path of the image file used as the cover for the library. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. -/// Whether this media library should update the metadata of its elements from the web, or not. -/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should update the metadata of its elements from the web, or not. +/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. [DebuggerDisplay("Title: {Title}")] public record AddLibraryCommand( string? Title, @@ -27,6 +28,7 @@ public record AddLibraryCommand( string? CoverImage, bool IsEnabled, bool IsLocked, - bool DownloadMedatadaFromWeb, - bool SaveMetadataInMediaDirectories + bool DownloadMetadataFromWeb, + bool ShouldSaveMetadataInMediaDirectories, + bool ShouldSkipUnchangedDirectoriesDuringScan ) : IRequest>; diff --git a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommandHandler.cs b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommandHandler.cs index 6f5f9976..0083ff4d 100644 --- a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommandHandler.cs +++ b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/AddLibrary/AddLibraryCommandHandler.cs @@ -65,7 +65,7 @@ public class AddLibraryCommandHandler : IRequestHandlerThe request to be handled. /// Cancellation token that can be used to stop the execution. /// - /// An containing either a successfuly created , or an error message. + /// An containing either a successfully created , or an error message. /// public async ValueTask> Handle(AddLibraryCommand request, CancellationToken cancellationToken) { @@ -98,8 +98,9 @@ public class AddLibraryCommandHandler : IRequestHandlerThe path of the image file used as the cover for the library. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. -/// Whether this media library should update the metadata of its elements from the web, or not. -/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should update the metadata of its elements from the web, or not. +/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. [DebuggerDisplay("Title: {Title}")] public record UpdateLibraryCommand( Guid Id, @@ -31,6 +32,7 @@ public record UpdateLibraryCommand( string? CoverImage, bool IsEnabled, bool IsLocked, - bool DownloadMedatadaFromWeb, - bool SaveMetadataInMediaDirectories + bool DownloadMetadataFromWeb, + bool ShouldSaveMetadataInMediaDirectories, + bool ShouldSkipUnchangedDirectoriesDuringScan ) : IRequest>; diff --git a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/UpdateLibrary/UpdateLibraryCommandHandler.cs b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/UpdateLibrary/UpdateLibraryCommandHandler.cs index 2f023a52..f7974192 100644 --- a/src/Lumina.Application/Core/MediaLibrary/Management/Commands/UpdateLibrary/UpdateLibraryCommandHandler.cs +++ b/src/Lumina.Application/Core/MediaLibrary/Management/Commands/UpdateLibrary/UpdateLibraryCommandHandler.cs @@ -68,7 +68,7 @@ public class UpdateLibraryCommandHandler : IRequestHandlerThe request to be handled. /// Cancellation token that can be used to stop the execution. /// - /// An containing either a successfuly updated , or an error message. + /// An containing either a successfully updated , or an error message. /// public async ValueTask> Handle(UpdateLibraryCommand request, CancellationToken cancellationToken) { @@ -110,8 +110,9 @@ public class UpdateLibraryCommandHandler : IRequestHandler ScanId.Create(libraryScan.Id)).ToList() ); if (createLibraryResult.IsError) diff --git a/src/Lumina.Application/Core/MediaLibrary/Management/Events/LibraryScanQueuedDomainEventHandler.cs b/src/Lumina.Application/Core/MediaLibrary/Management/Events/LibraryScanQueuedDomainEventHandler.cs index 4926a4bb..17ee8a78 100644 --- a/src/Lumina.Application/Core/MediaLibrary/Management/Events/LibraryScanQueuedDomainEventHandler.cs +++ b/src/Lumina.Application/Core/MediaLibrary/Management/Events/LibraryScanQueuedDomainEventHandler.cs @@ -63,7 +63,7 @@ public class LibraryScanQueuedDomainEventHandler : INotificationHandler startScanResult = await _mediaLibraryScanningService.StartScanAsync( - libraryScanDomainResult.Value, getLibraryScanResult.Value.Library.LibraryType, getLibraryScanResult.Value.Library.DownloadMedatadaFromWeb, cancellationToken).ConfigureAwait(false); + libraryScanDomainResult.Value, getLibraryScanResult.Value.Library.LibraryType, getLibraryScanResult.Value.Library.DownloadMetadataFromWeb, cancellationToken).ConfigureAwait(false); if (startScanResult.IsError) throw new EventualConsistencyException(startScanResult.FirstError, startScanResult.Errors); diff --git a/src/Lumina.Contracts/Requests/MediaLibrary/Management/AddLibraryRequest.cs b/src/Lumina.Contracts/Requests/MediaLibrary/Management/AddLibraryRequest.cs index 9b0021db..bfc717ba 100644 --- a/src/Lumina.Contracts/Requests/MediaLibrary/Management/AddLibraryRequest.cs +++ b/src/Lumina.Contracts/Requests/MediaLibrary/Management/AddLibraryRequest.cs @@ -13,8 +13,9 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management; /// The path of the image file used as the cover for the library. Optional. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional. -/// Whether this media library should update the metadata of its elements from the web, or not. Optional. -/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional. +/// Whether this media library should update the metadata of its elements from the web, or not. Optional. +/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional. +/// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional. [DebuggerDisplay("Title: {Title}")] public record AddLibraryRequest( string? Title, @@ -23,6 +24,7 @@ public record AddLibraryRequest( string? CoverImage, bool IsEnabled, bool IsLocked, - bool DownloadMedatadaFromWeb, - bool SaveMetadataInMediaDirectories + bool DownloadMetadataFromWeb, + bool ShouldSaveMetadataInMediaDirectories, + bool ShouldSkipUnchangedDirectoriesDuringScan ); diff --git a/src/Lumina.Contracts/Requests/MediaLibrary/Management/UpdateLibraryRequest.cs b/src/Lumina.Contracts/Requests/MediaLibrary/Management/UpdateLibraryRequest.cs index c718ab86..2f18881a 100644 --- a/src/Lumina.Contracts/Requests/MediaLibrary/Management/UpdateLibraryRequest.cs +++ b/src/Lumina.Contracts/Requests/MediaLibrary/Management/UpdateLibraryRequest.cs @@ -18,8 +18,9 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management; /// The path of the image file used as the cover for the library. Optional. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional. -/// Whether this media library should update the metadata of its elements from the web, or not. Optional. -/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should update the metadata of its elements from the web, or not. Optional. +/// Whether this media library should copy the downloaded metadata into the media library content locations, or not. +/// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional. [DebuggerDisplay("Title: {Title}")] public record class UpdateLibraryRequest( Guid Id, @@ -30,6 +31,7 @@ public record class UpdateLibraryRequest( string? CoverImage, bool IsEnabled, bool IsLocked, - bool DownloadMedatadaFromWeb, - bool SaveMetadataInMediaDirectories + bool DownloadMetadataFromWeb, + bool ShouldSaveMetadataInMediaDirectories, + bool ShouldSkipUnchangedDirectoriesDuringScan ); diff --git a/src/Lumina.Contracts/Responses/MediaLibrary/Management/LibraryResponse.cs b/src/Lumina.Contracts/Responses/MediaLibrary/Management/LibraryResponse.cs index 98bd578f..4cc80534 100644 --- a/src/Lumina.Contracts/Responses/MediaLibrary/Management/LibraryResponse.cs +++ b/src/Lumina.Contracts/Responses/MediaLibrary/Management/LibraryResponse.cs @@ -28,8 +28,9 @@ public record LibraryResponse( string? CoverImage, bool IsEnabled, bool IsLocked, - bool DownloadMedatadaFromWeb, - bool SaveMetadataInMediaDirectories, + bool DownloadMetadataFromWeb, + bool ShouldSaveMetadataInMediaDirectories, + bool ShouldSkipUnchangedDirectoriesDuringScan, DateTime CreatedOnUtc, DateTime? UpdatedOnUtc ); diff --git a/src/Lumina.DataAccess/Common/Configuration/LibraryConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/LibraryConfiguration.cs index 77d66a5b..6e085ae3 100644 --- a/src/Lumina.DataAccess/Common/Configuration/LibraryConfiguration.cs +++ b/src/Lumina.DataAccess/Common/Configuration/LibraryConfiguration.cs @@ -46,13 +46,16 @@ public class LibraryConfiguration : IEntityTypeConfiguration builder.Property(library => library.IsLocked) .HasColumnOrder(5); - builder.Property(library => library.DownloadMedatadaFromWeb) + builder.Property(library => library.DownloadMetadataFromWeb) .HasDefaultValue(true) .HasColumnOrder(6); - builder.Property(library => library.SaveMetadataInMediaDirectories) + builder.Property(library => library.ShouldSaveMetadataInMediaDirectories) .HasColumnOrder(7); + builder.Property(library => library.ShouldSkipUnchangedDirectoriesDuringScan) + .HasColumnOrder(8); + // one user with many libraries builder.HasOne(library => library.User) .WithMany(user => user.Libraries) @@ -85,18 +88,18 @@ public class LibraryConfiguration : IEntityTypeConfiguration // audit builder.Property(library => library.CreatedOnUtc) .IsRequired() - .HasColumnOrder(8); + .HasColumnOrder(9); builder.Property(library => library.CreatedBy) .IsRequired() - .HasColumnOrder(9); + .HasColumnOrder(10); builder.Property(library => library.UpdatedOnUtc) .HasDefaultValue(null) - .HasColumnOrder(10); + .HasColumnOrder(11); builder.Property(library => library.UpdatedBy) .HasDefaultValue(null) - .HasColumnOrder(11); + .HasColumnOrder(12); } } diff --git a/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.Designer.cs b/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.Designer.cs new file mode 100644 index 00000000..3b1c3929 --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.Designer.cs @@ -0,0 +1,1019 @@ +// +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("20260809190243_RenamesLibraryScanSettingsColumns")] + partial class RenamesLibraryScanSettingsColumns + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.0"); + + 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.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("CoverImage") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("DownloadMetadataFromWeb") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true) + .HasColumnOrder(6); + + 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("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(12); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + 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.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("LibraryThingId") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(26); + + 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("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("INTEGER") + .HasColumnOrder(20); + + b.HasKey("Id"); + + b.ToTable("Books", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("Password") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("TempPassword") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("TempPasswordCreated") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("TotpSecret") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Username") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("BookGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BookTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("RolePermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("UserPermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("UserPermissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithOne("UserRole") + .HasForeignKey("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", null) + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("Libraries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryContentLocationEntity", "ContentLocations", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("LibraryId") + .HasColumnType("TEXT"); + + b1.Property("Path") + .IsRequired() + .HasMaxLength(260) + .HasColumnType("TEXT") + .HasColumnName("Path"); + + b1.HasKey("Id"); + + b1.HasIndex("LibraryId"); + + b1.ToTable("LibraryContentLocations", (string)null); + + b1.WithOwner() + .HasForeignKey("LibraryId"); + }); + + b.Navigation("ContentLocations"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany("LibraryScans") + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("LibraryScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", "LibraryScan") + .WithMany("LibraryScanResults") + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LibraryScan"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", null) + .WithMany() + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.IsbnEntity", "ISBNs", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("Format") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("TEXT") + .HasColumnName("ISBN"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookISBNs", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.Navigation("ISBNs"); + + b.Navigation("Ratings"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserPermissions"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.Navigation("LibraryScans"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.Navigation("LibraryScanResults"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Navigation("Libraries"); + + b.Navigation("LibraryScans"); + + b.Navigation("UserPermissions"); + + b.Navigation("UserRole"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.cs b/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.cs new file mode 100644 index 00000000..a75a570b --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20260809190243_RenamesLibraryScanSettingsColumns.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lumina.DataAccess.Common.Migrations +{ + /// + public partial class RenamesLibraryScanSettingsColumns : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "SkipUnchangedDirectoriesDuringScan", + table: "Libraries", + newName: "ShouldSkipUnchangedDirectoriesDuringScan"); + + migrationBuilder.RenameColumn( + name: "SaveMetadataInMediaDirectories", + table: "Libraries", + newName: "ShouldSaveMetadataInMediaDirectories"); + + migrationBuilder.RenameColumn( + name: "DownloadMedatadaFromWeb", + table: "Libraries", + newName: "DownloadMetadataFromWeb"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "ShouldSkipUnchangedDirectoriesDuringScan", + table: "Libraries", + newName: "SkipUnchangedDirectoriesDuringScan"); + + migrationBuilder.RenameColumn( + name: "ShouldSaveMetadataInMediaDirectories", + table: "Libraries", + newName: "SaveMetadataInMediaDirectories"); + + migrationBuilder.RenameColumn( + name: "DownloadMetadataFromWeb", + table: "Libraries", + newName: "DownloadMedatadaFromWeb"); + } + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryAggregate/Library.cs b/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryAggregate/Library.cs index 7fbfb7c5..4666f1fb 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryAggregate/Library.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/LibraryManagementBoundedContext/LibraryAggregate/Library.cs @@ -63,12 +63,18 @@ public class Library : AggregateRoot /// /// Gets whether this media library should update the metadata of its elements from the web, or not. /// - public bool DownloadMedatadaFromWeb { get; private set; } = true; + public bool DownloadMetadataFromWeb { get; private set; } = true; /// /// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not. /// - public bool SaveMetadataInMediaDirectories { get; private set; } + public bool ShouldSaveMetadataInMediaDirectories { get; private set; } + + /// + /// Gets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan. This is an opt-in setting, because it relies on directory metadata, + /// which does not change when the contents of an existing file are edited, and such edits could be missed while this setting is enabled. + /// + public bool ShouldSkipUnchangedDirectoriesDuringScan { get; private set; } /// /// Gets the list of objects representing the file system paths that make up the media library. @@ -91,8 +97,9 @@ public class Library : AggregateRoot /// The path of the image file used as the cover for the library. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. - /// Whether this media library should update the metadata of its elements from the web, or not. - /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should update the metadata of its elements from the web, or not. + /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. /// The list of objects representing the unique identifier of scans of the media library. private Library( LibraryId id, @@ -103,8 +110,9 @@ public class Library : AggregateRoot string? coverImage, bool isEnabled, bool isLocked, - bool downloadMedatadaFromWeb, - bool saveMetadataInMediaDirectories, + bool downloadMetadataFromWeb, + bool shouldSaveMetadataInMediaDirectories, + bool shouldSkipUnchangedDirectoriesDuringScan, List scanIds) : base(id) { UserId = userId; @@ -114,8 +122,9 @@ public class Library : AggregateRoot CoverImage = coverImage; IsEnabled = isEnabled; IsLocked = isLocked; - DownloadMedatadaFromWeb = downloadMedatadaFromWeb; - SaveMetadataInMediaDirectories = saveMetadataInMediaDirectories; + DownloadMetadataFromWeb = downloadMetadataFromWeb; + ShouldSaveMetadataInMediaDirectories = shouldSaveMetadataInMediaDirectories; + ShouldSkipUnchangedDirectoriesDuringScan = shouldSkipUnchangedDirectoriesDuringScan; _scanIds = scanIds; } @@ -129,11 +138,12 @@ public class Library : AggregateRoot /// The path of the image file chosen by the user to be used as the cover for the library. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. - /// Whether this media library should update the metadata of its elements from the web, or not. - /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should update the metadata of its elements from the web, or not. + /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. /// The list of objects representing the unique identifier of scans of the media library. /// - /// An containing either a successfuly created , or an error message. + /// An containing either a successfully created , or an error message. /// public static ErrorOr Create( UserId userId, @@ -143,8 +153,9 @@ public class Library : AggregateRoot string? coverImageSourcePath, bool isEnabled, bool isLocked, - bool downloadMedatadaFromWeb, - bool saveMetadataInMediaDirectories, + bool downloadMetadataFromWeb, + bool shouldSaveMetadataInMediaDirectories, + bool shouldSkipUnchangedDirectoriesDuringScan, List scanIds) { List tempContentLocations = []; @@ -165,8 +176,9 @@ public class Library : AggregateRoot coverImageSourcePath, isEnabled, isLocked, - downloadMedatadaFromWeb, - saveMetadataInMediaDirectories, + downloadMetadataFromWeb, + shouldSaveMetadataInMediaDirectories, + shouldSkipUnchangedDirectoriesDuringScan, scanIds ); } @@ -182,11 +194,12 @@ public class Library : AggregateRoot /// The path of the image file chosen by the user to be used as the cover for the library. /// Whether this media library is enabled or not. A disabled media library is never shown or changed. /// Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. - /// Whether this media library should update the metadata of its elements from the web, or not. - /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should update the metadata of its elements from the web, or not. + /// Whether this media library should copy the downloaded metadata into the media library content locations, or not. + /// Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. /// The list of objects representing the unique identifier of scans of the media library. /// - /// An containing either a successfuly created , or an error message. + /// An containing either a successfully created , or an error message. /// public static ErrorOr Create( LibraryId id, @@ -197,8 +210,9 @@ public class Library : AggregateRoot string? coverImageSourcePath, bool isEnabled, bool isLocked, - bool downloadMedatadaFromWeb, - bool saveMetadataInMediaDirectories, + bool downloadMetadataFromWeb, + bool shouldSaveMetadataInMediaDirectories, + bool shouldSkipUnchangedDirectoriesDuringScan, List scanIds) { List tempContentLocations = []; @@ -219,8 +233,9 @@ public class Library : AggregateRoot coverImageSourcePath, isEnabled, isLocked, - downloadMedatadaFromWeb, - saveMetadataInMediaDirectories, + downloadMetadataFromWeb, + shouldSaveMetadataInMediaDirectories, + shouldSkipUnchangedDirectoriesDuringScan, scanIds ); } diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/Management/AddLibrary/AddLibraryEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/Management/AddLibrary/AddLibraryEndpointSummary.cs index 72cc4a77..e2c70d12 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/Management/AddLibrary/AddLibraryEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/Management/AddLibrary/AddLibraryEndpointSummary.cs @@ -34,8 +34,9 @@ public class AddLibraryEndpointSummary : Summary r.Title, "The title of the media library. Required."); @@ -44,8 +45,9 @@ public class AddLibraryEndpointSummary : Summary r.CoverImage, "The path of the image file used as the cover for the library. Optional."); RequestParam(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional."); RequestParam(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional."); - RequestParam(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not. Optional."); - RequestParam(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional."); + RequestParam(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not. Optional."); + RequestParam(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional."); + RequestParam(r => r.ShouldSkipUnchangedDirectoriesDuringScan, "Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional."); ResponseParam(r => r.Id, "The unique identifier of the entity."); ResponseParam(r => r.UserId, "The unique identifier of the user owning the media library."); @@ -55,12 +57,13 @@ public class AddLibraryEndpointSummary : Summary(r => r.CoverImage, "The path of the image file used as the cover for the library."); ResponseParam(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed."); ResponseParam(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated."); - ResponseParam(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); - ResponseParam(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); + ResponseParam(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.ShouldSkipUnchangedDirectoriesDuringScan, "Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not."); ResponseParam(r => r.CreatedOnUtc, "The date and time when the entity was created."); ResponseParam(r => r.UpdatedOnUtc, "The date and time when the entity was last updated."); - Response(201, "The media library was successfuly created.", example: + Response(201, "The media library was successfully created.", example: new LibraryResponse( Id: Guid.NewGuid(), UserId: Guid.NewGuid(), @@ -70,8 +73,9 @@ public class AddLibraryEndpointSummary : Summary(r => r.CoverImage, "The path of the image file used as the cover for the library."); ResponseParam(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed."); ResponseParam(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated."); - ResponseParam(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); - ResponseParam(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); + ResponseParam(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.ShouldSkipUnchangedDirectoriesDuringScan, "Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not."); ResponseParam(r => r.CreatedOnUtc, "The date and time when the entity was created."); ResponseParam(r => r.UpdatedOnUtc, "The date and time when the entity was last updated."); @@ -52,8 +53,9 @@ public class GetLibraryEndpointSummary : Summary r.Id, "The unique identifier of the media library. Required."); @@ -48,8 +49,9 @@ public class UpdateLibraryEndpointSummary : Summary r.CoverImage, "The path of the image file used as the cover for the library. Optional."); RequestParam(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional."); RequestParam(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional."); - RequestParam(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not. Optional."); - RequestParam(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional."); + RequestParam(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not. Optional."); + RequestParam(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional."); + RequestParam(r => r.ShouldSkipUnchangedDirectoriesDuringScan, "Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional."); ResponseParam(r => r.Id, "The unique identifier of the entity."); ResponseParam(r => r.UserId, "The unique identifier of the user owning the media library."); @@ -59,12 +61,13 @@ public class UpdateLibraryEndpointSummary : Summary(r => r.CoverImage, "The path of the image file used as the cover for the library."); ResponseParam(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed."); ResponseParam(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated."); - ResponseParam(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); - ResponseParam(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not."); + ResponseParam(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not."); + ResponseParam(r => r.ShouldSkipUnchangedDirectoriesDuringScan, "Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not."); ResponseParam(r => r.CreatedOnUtc, "The date and time when the entity was created."); ResponseParam(r => r.UpdatedOnUtc, "The date and time when the entity was last updated."); - Response(200, "The media library was successfuly updated.", example: + Response(200, "The media library was successfully updated.", example: new LibraryResponse( Id: Guid.NewGuid(), UserId: Guid.NewGuid(), @@ -74,8 +77,9 @@ public class UpdateLibraryEndpointSummary : Summary /// Gets or sets whether this media library should update the metadata of its elements from the web, or not. /// - public bool DownloadMedatadaFromWeb { get; set; } = true; + public bool DownloadMetadataFromWeb { get; set; } = true; /// /// Gets or sets whether this media library should copy the downloaded metadata into the media library content locations, or not. /// - public bool SaveMetadataInMediaDirectories { get; set; } = false; + public bool ShouldSaveMetadataInMediaDirectories { get; set; } = false; + + /// + /// Gets or sets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan. This is an opt-in setting, because it relies on directory metadata, + /// which does not change when the contents of an existing file are edited, and such edits could be missed while this setting is enabled. + /// + public bool ShouldSkipUnchangedDirectoriesDuringScan { get; set; } = false; } diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.Designer.cs b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.Designer.cs index 891a627c..63eaff32 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.Designer.cs +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -261,9 +261,9 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management { /// /// Looks up a localized string similar to Whether to save a copy of the downloaded metadata in the media library content locations directories, or not. This only has an effect if downloading metadata from the web is active.. /// - public static string DescriptionSaveMetadataInMediaDirectories { + public static string DescriptionShouldSaveMetadataInMediaDirectories { get { - return ResourceManager.GetString("DescriptionSaveMetadataInMediaDirectories", resourceCulture); + return ResourceManager.GetString("DescriptionShouldSaveMetadataInMediaDirectories", resourceCulture); } } @@ -531,9 +531,9 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management { /// /// Looks up a localized string similar to Save Metadata In Media Directories. /// - public static string SaveMetadataInMediaDirectories { + public static string ShouldSaveMetadataInMediaDirectories { get { - return ResourceManager.GetString("SaveMetadataInMediaDirectories", resourceCulture); + return ResourceManager.GetString("ShouldSaveMetadataInMediaDirectories", resourceCulture); } } diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.de-DE.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.de-DE.resx index e630247e..37fe1da0 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.de-DE.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.de-DE.resx @@ -183,9 +183,12 @@ Ob diese Medienbibliothek gesperrt ist oder nicht. Eine gesperrte Bibliothek wird den Benutzern angezeigt, wird aber nie gescannt, aktualisiert, verändert, usw. - + Ob eine Kopie der heruntergeladenen Metadaten in den Verzeichnissen der Medienbibliothek gespeichert werden soll oder nicht. Dies hat nur eine Auswirkung, wenn das Herunterladen von Metadaten aus dem Web aktiv ist. + + Wenn diese Option aktiviert ist, verwendet sie Verzeichnismetadaten, um Verzeichnisse zu überspringen, die sich seit dem letzten Scan nicht geändert haben. Dies kann die Scans _erheblich_ beschleunigen, aber beachten Sie, dass sich die Metadaten von Verzeichnissen _nicht_ ändern/aktualisieren, wenn vorhandene Dateien bearbeitet werden, sondern nur, wenn neue Dateien hinzugefügt oder vorhandene gelöscht werden. Aktivieren Sie diese Option nur, wenn Sie keine vorhandenen Dateien ändern. + Eine Bezeichnung für diese Bibliothek @@ -273,9 +276,12 @@ Speichern - + Metadaten In Medienverzeichnissen Speichern + + Unveränderte Ordner Beim Scannen Überspringen + Drehbuch diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.en-US.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.en-US.resx index ea47cf88..97df4b4a 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.en-US.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.en-US.resx @@ -183,9 +183,12 @@ Whether this media library is locked or not. A locked library is displayed to the users, but it is never scanned, updated, modified, etc. - + Whether to save a copy of the downloaded metadata in the media library content locations directories, or not. This only has an effect if downloading metadata from the web is active. + + When enabled, this option uses directory metadata to skip directories that have not changed since the last scan. This can _significantly_ speed up scans, but be aware that directories metadata _does not_ change/update when editing existing files, it does so only when adding new files or deleting existing ones. Only enable this if you don't modify existing files. + A name to identify this library @@ -273,9 +276,12 @@ Save - + Save Metadata In Media Directories + + Skip Unchanged Directories During Scan + Screenplay diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.es-ES.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.es-ES.resx index 5d3732d1..fcc0e3d4 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.es-ES.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.es-ES.resx @@ -183,9 +183,12 @@ Si esta biblioteca multimedia está bloqueada o no. Una biblioteca bloqueada se muestra a los usuarios, pero nunca se escanea, actualiza, modifica, etc. - + Si guardar o no una copia de los metadatos descargados en los directorios de contenido de la biblioteca multimedia. Esto solo tiene efecto si la descarga de metadatos desde la web está activa. + + Cuando esta opción está habilitada, utiliza los metadatos de los directorios para omitir los directorios que no han cambiado desde el último escaneo. Esto puede acelerar _significativamente_ los escaneos, pero tenga en cuenta que los metadatos de los directorios _no_ cambian/actualizan al editar archivos existentes, solo lo hacen al agregar archivos nuevos o eliminar archivos existentes. Habilite esta opción solo si no modifica archivos existentes. + Un nombre para identificar esta biblioteca @@ -273,9 +276,12 @@ Guardar - + Guardar Metadatos En Los Directorios Multimedia + + Omitir Carpetas Sin Cambios Durante El Escaneo + Guión diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.fr-FR.resx index 702920cb..7bfb65fc 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.fr-FR.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.fr-FR.resx @@ -183,9 +183,12 @@ Si cette médiathèque est verrouillée ou non. Une bibliothèque verrouillée est affichée aux utilisateurs, mais n'est jamais analysée, mise à jour, modifiée, etc. - + Si une copie des métadonnées téléchargées doit être sauvegardée dans les répertoires de contenu de la médiathèque ou non. Ceci n'a d'effet que si le téléchargement des métadonnées depuis le web est actif. + + Lorsque cette option est activée, elle utilise les métadonnées des dossiers pour ignorer les dossiers qui n'ont pas changé depuis la dernière analyse. Cela peut accélérer _considérablement_ les analyses, mais sachez que les métadonnées des dossiers _ne_ changent/mettent _pas_ à jour lors de la modification de fichiers existants, seulement lors de l'ajout de nouveaux fichiers ou de la suppression de fichiers existants. N'activez cette option que si vous ne modifiez pas les fichiers existants. + Un nom pour identifier cette bibliothèque @@ -273,9 +276,12 @@ Enregistrer - + Sauvegarder Les Métadonnées Dans Les Répertoires Média + + Ignorer Les Dossiers Inchangés Lors De L'Analyse + Scénario diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.it-IT.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.it-IT.resx index d0b07797..5274edc2 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.it-IT.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.it-IT.resx @@ -183,9 +183,12 @@ Se questa libreria multimediale è bloccata o meno. Una libreria bloccata viene mostrata agli utenti, ma non viene mai scansionata, aggiornata, modificata, ecc. - + Se salvare o meno una copia dei metadati scaricati nelle directory dei contenuti della libreria multimediale. Questo ha effetto solo se il download dei metadati dal web è attivo. + + Quando questa opzione è abilitata, utilizza i metadati delle cartelle per saltare le cartelle che non sono cambiate dall'ultima scansione. Questo può accelerare _significativamente_ le scansioni, ma tieni presente che i metadati delle cartelle _non_ cambiano/aggiornano quando si modificano file esistenti, lo fanno solo quando si aggiungono nuovi file o si eliminano file esistenti. Abilita questa opzione solo se non modifichi i file esistenti. + Un nome per identificare questa biblioteca @@ -273,9 +276,12 @@ Salva - + Salvare I Metadati Nelle Directory Multimediali + + Salta Cartelle Invariate Durante La Scansione + Sceneggiatura diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ja-JP.resx index 791fd9d6..bbfa5064 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ja-JP.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ja-JP.resx @@ -183,9 +183,12 @@ このメディアライブラリがロックされているかどうか。ロックされたライブラリはユーザーに表示されますが、スキャン、更新、変更などは一切されません。 - + ダウンロードしたメタデータのコピーをメディアライブラリのコンテンツディレクトリに保存するかどうか。これはウェブからのメタデータのダウンロードが有効な場合のみ効果があります。 + + このオプションを有効にすると、ディレクトリのメタデータを使用して、前回のスキャン以降に変更されていないディレクトリをスキップします。これによりスキャンを_大幅に_高速化できますが、既存のファイルを編集してもディレクトリのメタデータは_変更/更新されない_ことに注意してください。変更されるのは、新しいファイルを追加したときや既存のファイルを削除したときだけです。既存のファイルを変更しない場合にのみ有効にしてください。 + この図書館を識別するための名称 @@ -273,9 +276,12 @@ 保存 - + メディアディレクトリにメタデータを保存 + + スキャン中に変更のないフォルダをスキップ + 脚本 diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.resx index ea47cf88..97df4b4a 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.resx @@ -183,9 +183,12 @@ Whether this media library is locked or not. A locked library is displayed to the users, but it is never scanned, updated, modified, etc. - + Whether to save a copy of the downloaded metadata in the media library content locations directories, or not. This only has an effect if downloading metadata from the web is active. + + When enabled, this option uses directory metadata to skip directories that have not changed since the last scan. This can _significantly_ speed up scans, but be aware that directories metadata _does not_ change/update when editing existing files, it does so only when adding new files or deleting existing ones. Only enable this if you don't modify existing files. + A name to identify this library @@ -273,9 +276,12 @@ Save - + Save Metadata In Media Directories + + Skip Unchanged Directories During Scan + Screenplay diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ro-RO.resx index 251ebb68..766e12aa 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ro-RO.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ro-RO.resx @@ -183,9 +183,12 @@ Dacă această bibliotecă media este blocată sau nu. O bibliotecă blocată este afișată utilizatorilor, dar nu este niciodată scanată, actualizată, modificată, etc. - + Dacă se salvează sau nu o copie a metadatelor descărcate în directoarele cu conținut ale bibliotecii media. Acest lucru are efect doar dacă descărcarea metadatelor de pe web este activă. + + Când această opțiune este activată, folosește metadatele directorului pentru a sări peste directoarele care nu s-au schimbat de la ultima scanare. Acest lucru poate accelera _semnificativ_ scanările, dar rețineți că metadatele directoarelor _nu_ se schimbă/actualizează atunci când editați fișiere existente, se schimbă doar atunci când adăugați fișiere noi sau ștergeți fișiere existente. Activați această opțiune numai dacă nu modificați fișierele existente. + Un nume pentru identificarea acestei biblioteci @@ -273,9 +276,12 @@ Salvează - + Salvează Metadatele În Directoarele Media + + Sari Peste Directorarele Neschimbate În Timpul Scanării + Scenariu diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ru-RU.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ru-RU.resx index 88bbd37f..a342b334 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ru-RU.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.ru-RU.resx @@ -183,9 +183,12 @@ Заблокирована эта медиатека или нет. Заблокированная библиотека отображается пользователям, но никогда не сканируется, не обновляется, не изменяется и т.д. - + Сохранять копию загруженных метаданных в каталогах содержимого медиатеки или нет. Это действует только если активна загрузка метаданных из интернета. + + При включении этой опции используются метаданные каталогов, чтобы пропускать каталоги, не изменявшиеся с момента последнего сканирования. Это может _значительно_ ускорить сканирование, но учтите, что метаданные каталогов _не_ изменяются/обновляются при редактировании существующих файлов, а только при добавлении новых или удалении существующих. Включайте эту опцию только в том случае, если вы не изменяете существующие файлы. + Название для этой библиотеки @@ -273,9 +276,12 @@ Сохранить - + Сохранить Метаданные В Каталогах Медиафайлов + + Пропускать Неизмененные Папки При Сканировании + Сценарий diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.zh-CN.resx index 3bbb6979..6ec96635 100644 --- a/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.zh-CN.resx +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/Management/Item.zh-CN.resx @@ -183,9 +183,12 @@ 此媒体库是否已锁定。锁定的库会显示给用户,但永远不会被扫描、更新、修改等。 - + 是否在媒体库内容位置目录中保存已下载元数据的副本。这仅在从网络下载元数据处于活动状态时才有效。 + + 启用此选项后,将使用目录元数据跳过自上次扫描以来未更改的目录。这可以_显著_加快扫描速度,但请注意,编辑现有文件时目录元数据_不会_更改/更新,只有在添加新文件或删除现有文件时才会更改。仅当您不修改现有文件时才启用此选项。 + 给这个图书馆起个名字 @@ -273,9 +276,12 @@ 保存 - + 在媒体目录中保存元数据 + + 扫描时跳过未更改的文件夹 + 剧本 diff --git a/src/Lumina.Presentation.Web/Views/Library/Management/Item.cshtml b/src/Lumina.Presentation.Web/Views/Library/Management/Item.cshtml index 6df068ca..f928383e 100644 --- a/src/Lumina.Presentation.Web/Views/Library/Management/Item.cshtml +++ b/src/Lumina.Presentation.Web/Views/Library/Management/Item.cshtml @@ -170,11 +170,11 @@
- : + :
@@ -182,15 +182,27 @@
- +
- @_localizer["DescriptionSaveMetadataInMediaDirectories"] + @_localizer["DescriptionShouldSaveMetadataInMediaDirectories"] +
+
+
+ +
+
+ +
+ @_localizer["DescriptionShouldSkipUnchangedDirectoriesDuringScan"]
@@ -220,8 +232,9 @@ const mediaDirectoriesFormTable = document.getElementById('add-media-directory-form-table'); const chkIsEnabled = form.querySelector('[name="IsEnabled"]'); const chkIsLocked = form.querySelector('[name="IsLocked"]'); - const chkDownloadMedatadaFromWeb = form.querySelector('[name="DownloadMedatadaFromWeb"]'); - const chkSaveMetadataInMediaDirectories = form.querySelector('[name="SaveMetadataInMediaDirectories"]'); + const chkDownloadMetadataFromWeb = form.querySelector('[name="DownloadMetadataFromWeb"]'); + const chkShouldSaveMetadataInMediaDirectories = form.querySelector('[name="ShouldSaveMetadataInMediaDirectories"]'); + const chkShouldSkipUnchangedDirectoriesDuringScan = form.querySelector('[name="ShouldSkipUnchangedDirectoriesDuringScan"]'); // create new or update existing media library async function handleAddMediaLibraryAsync() { @@ -239,8 +252,9 @@ })(), IsEnabled: chkIsEnabled.checked, IsLocked: chkIsLocked.checked, - DownloadMedatadaFromWeb: chkDownloadMedatadaFromWeb.checked, - SaveMetadataInMediaDirectories: chkSaveMetadataInMediaDirectories.checked + DownloadMetadataFromWeb: chkDownloadMetadataFromWeb.checked, + ShouldSaveMetadataInMediaDirectories: chkShouldSaveMetadataInMediaDirectories.checked, + ShouldSkipUnchangedDirectoriesDuringScan: chkShouldSkipUnchangedDirectoriesDuringScan.checked }; const data = await callApiPostAsync('@_urlService.GetAbsoluteUrl("SaveLibrary", "LibraryManagement")', formData); if (data) { diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMappingTests.cs index 0064f3e5..44c19ee2 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/AddMediaLibraryRequestMappingTests.cs @@ -26,6 +26,7 @@ public class AddMediaLibraryRequestMappingTests true, false, true, + false, false ); @@ -40,8 +41,8 @@ public class AddMediaLibraryRequestMappingTests Assert.Equal(request.CoverImage, result.CoverImage); Assert.Equal(request.IsEnabled, result.IsEnabled); Assert.Equal(request.IsLocked, result.IsLocked); - Assert.Equal(request.DownloadMedatadaFromWeb, result.DownloadMedatadaFromWeb); - Assert.Equal(request.SaveMetadataInMediaDirectories, result.SaveMetadataInMediaDirectories); + Assert.Equal(request.DownloadMetadataFromWeb, result.DownloadMetadataFromWeb); + Assert.Equal(request.ShouldSaveMetadataInMediaDirectories, result.ShouldSaveMetadataInMediaDirectories); } [Theory] @@ -60,6 +61,7 @@ public class AddMediaLibraryRequestMappingTests true, false, true, + false, false ); @@ -74,8 +76,8 @@ public class AddMediaLibraryRequestMappingTests Assert.Equal(request.CoverImage, result.CoverImage); Assert.Equal(request.IsEnabled, result.IsEnabled); Assert.Equal(request.IsLocked, result.IsLocked); - Assert.Equal(request.DownloadMedatadaFromWeb, result.DownloadMedatadaFromWeb); - Assert.Equal(request.SaveMetadataInMediaDirectories, result.SaveMetadataInMediaDirectories); + Assert.Equal(request.DownloadMetadataFromWeb, result.DownloadMetadataFromWeb); + Assert.Equal(request.ShouldSaveMetadataInMediaDirectories, result.ShouldSaveMetadataInMediaDirectories); } [Fact] @@ -98,6 +100,7 @@ public class AddMediaLibraryRequestMappingTests true, false, true, + false, false ); @@ -127,6 +130,7 @@ public class AddMediaLibraryRequestMappingTests true, false, true, + false, false ); diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/LibraryMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/LibraryMappingTests.cs index d41ebf26..6ab208e4 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/LibraryMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/MediaLibrary/Management/LibraryMappingTests.cs @@ -35,6 +35,7 @@ public class LibraryMappingTests false, true, false, + false, [ScanId.CreateUnique()] ); Library library = libraryResult.Value; @@ -54,8 +55,8 @@ public class LibraryMappingTests Assert.Equal(library.UpdatedOnUtc, result.UpdatedOnUtc); Assert.True(result.IsEnabled); Assert.False(result.IsLocked); - Assert.True(result.DownloadMedatadaFromWeb); - Assert.False(result.SaveMetadataInMediaDirectories); + Assert.True(result.DownloadMetadataFromWeb); + Assert.False(result.ShouldSaveMetadataInMediaDirectories); Assert.Equal(library.ScanIds.Select(scanId => scanId.Value), result.LibraryScans.Select(libraryScan => libraryScan.Id)); } @@ -73,6 +74,7 @@ public class LibraryMappingTests false, true, false, + false, [ScanId.CreateUnique()] ); Library library = libraryResult.Value; @@ -104,6 +106,7 @@ public class LibraryMappingTests false, true, false, + false, [ScanId.CreateUnique()] ); Library library = libraryResult.Value; @@ -117,8 +120,8 @@ public class LibraryMappingTests Assert.Equal(library.CoverImage, result.CoverImage); Assert.True(result.IsEnabled); Assert.False(result.IsLocked); - Assert.True(result.DownloadMedatadaFromWeb); - Assert.False(result.SaveMetadataInMediaDirectories); + Assert.True(result.DownloadMetadataFromWeb); + Assert.False(result.ShouldSaveMetadataInMediaDirectories); } [Fact] @@ -143,6 +146,7 @@ public class LibraryMappingTests false, true, false, + false, [ScanId.CreateUnique()] ); Library library = libraryResult.Value; @@ -176,6 +180,7 @@ public class LibraryMappingTests false, true, false, + false, [ScanId.CreateUnique()] ); Library library = libraryResult.Value; @@ -209,6 +214,7 @@ public class LibraryMappingTests false, true, false, + false, [] ); Library library = libraryResult.Value; diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/Management/Fixtures/DomainLibraryFixture.cs b/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/Management/Fixtures/DomainLibraryFixture.cs index 802a4f2b..68116930 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/Management/Fixtures/DomainLibraryFixture.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/Management/Fixtures/DomainLibraryFixture.cs @@ -55,6 +55,7 @@ public class DomainLibraryFixture _faker.Random.Bool(), _faker.Random.Bool(), _faker.Random.Bool(), + _faker.Random.Bool(), [ScanId.CreateUnique(), ScanId.CreateUnique()] ); @@ -70,8 +71,9 @@ public class DomainLibraryFixture string? coverImage = null, bool isEnabled = true, bool isLocked = false, - bool downloadMedatadaFromWeb = true, - bool saveMetadataInMediaDirectories = false, + bool downloadMetadataFromWeb = true, + bool shouldSaveMetadataInMediaDirectories = false, + bool shouldSkipUnchangedDirectoriesDuringScan = false, IEnumerable? scanIds = null) { ErrorOr library = id is null ? @@ -83,8 +85,9 @@ public class DomainLibraryFixture coverImage, isEnabled, isLocked, - downloadMedatadaFromWeb, - saveMetadataInMediaDirectories, + downloadMetadataFromWeb, + shouldSaveMetadataInMediaDirectories, + shouldSkipUnchangedDirectoriesDuringScan, scanIds?.Select(scanId => ScanId.Create(scanId)).ToList() ?? [ScanId.CreateUnique(), ScanId.CreateUnique()] ) : Library.Create( @@ -96,8 +99,9 @@ public class DomainLibraryFixture coverImage, isEnabled, isLocked, - downloadMedatadaFromWeb, - saveMetadataInMediaDirectories, + downloadMetadataFromWeb, + shouldSaveMetadataInMediaDirectories, + shouldSkipUnchangedDirectoriesDuringScan, scanIds?.Select(scanId => ScanId.Create(scanId)).ToList() ?? [ScanId.CreateUnique(), ScanId.CreateUnique()] );