Adds the opt-in directory fast skip scan setting and renames the library scan settings for consistency

This commit is contained in:
BinaryAlley committed 2026-08-09 13:18:07 -07:00
1 parent cce145e522
commit 9c2e5452da
38 files changed
+1360 -146

No files matched your search

@@ -63,12 +63,17 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
/// <summary>
/// Gets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMedatadaFromWeb { get; init; }
public bool DownloadMetadataFromWeb { get; init; }
/// <summary>
/// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool SaveMetadataInMediaDirectories { get; init; }
public bool ShouldSaveMetadataInMediaDirectories { get; init; }
/// <summary>
/// Gets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; }
/// <summary>
/// Gets the user that owns the media library.
@@ -27,8 +27,9 @@ public static class AddMediaLibraryRequestMapping
request.CoverImage,
request.IsEnabled,
request.IsLocked,
request.DownloadMedatadaFromWeb,
request.SaveMetadataInMediaDirectories
request.DownloadMetadataFromWeb,
request.ShouldSaveMetadataInMediaDirectories,
request.ShouldSkipUnchangedDirectoriesDuringScan
);
}
}
@@ -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
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Library"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Library"/>, or an error message.
/// </returns>
public static ErrorOr<Library> 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()
);
}
@@ -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,
@@ -27,8 +27,9 @@ public static class UpdateLibraryRequestMapping
request.CoverImage,
request.IsEnabled,
request.IsLocked,
request.DownloadMedatadaFromWeb,
request.SaveMetadataInMediaDirectories
request.DownloadMetadataFromWeb,
request.ShouldSaveMetadataInMediaDirectories,
request.ShouldSkipUnchangedDirectoriesDuringScan
);
}
}
@@ -17,8 +17,9 @@ namespace Lumina.Application.Core.MediaLibrary.Management.Commands.AddLibrary;
/// <param name="CoverImage">The path of the image file used as the cover for the library.</param>
/// <param name="IsEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed.</param>
/// <param name="IsLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.</param>
/// <param name="DownloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="SaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="DownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="ShouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="ShouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
[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<ErrorOr<LibraryResponse>>;
@@ -65,7 +65,7 @@ public class AddLibraryCommandHandler : IRequestHandler<AddLibraryCommand, Error
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LibraryResponse>> Handle(AddLibraryCommand request, CancellationToken cancellationToken)
{
@@ -98,8 +98,9 @@ public class AddLibraryCommandHandler : IRequestHandler<AddLibraryCommand, Error
request.CoverImage,
request.IsEnabled,
request.IsLocked,
request.DownloadMedatadaFromWeb,
request.SaveMetadataInMediaDirectories,
request.DownloadMetadataFromWeb,
request.ShouldSaveMetadataInMediaDirectories,
request.ShouldSkipUnchangedDirectoriesDuringScan,
[]
);
@@ -19,8 +19,9 @@ namespace Lumina.Application.Core.MediaLibrary.Management.Commands.UpdateLibrary
/// <param name="CoverImage">The path of the image file used as the cover for the library.</param>
/// <param name="IsEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed.</param>
/// <param name="IsLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.</param>
/// <param name="DownloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="SaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="DownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="ShouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="ShouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
[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<ErrorOr<LibraryResponse>>;
@@ -68,7 +68,7 @@ public class UpdateLibraryCommandHandler : IRequestHandler<UpdateLibraryCommand,
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly updated <see cref="LibraryResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully updated <see cref="LibraryResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LibraryResponse>> Handle(UpdateLibraryCommand request, CancellationToken cancellationToken)
{
@@ -110,8 +110,9 @@ public class UpdateLibraryCommandHandler : IRequestHandler<UpdateLibraryCommand,
request.CoverImage,
request.IsEnabled,
request.IsLocked,
request.DownloadMedatadaFromWeb,
request.SaveMetadataInMediaDirectories,
request.DownloadMetadataFromWeb,
request.ShouldSaveMetadataInMediaDirectories,
request.ShouldSkipUnchangedDirectoriesDuringScan,
getLibraryResult.Value.LibraryScans.Select(libraryScan => ScanId.Create(libraryScan.Id)).ToList()
);
if (createLibraryResult.IsError)
@@ -63,7 +63,7 @@ public class LibraryScanQueuedDomainEventHandler : INotificationHandler<LibraryS
// start the media library scan
ErrorOr<Success> 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);
@@ -13,8 +13,9 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management;
/// <param name="CoverImage">The path of the image file used as the cover for the library. Optional.</param>
/// <param name="IsEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional.</param>
/// <param name="IsLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional.</param>
/// <param name="DownloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not. Optional.</param>
/// <param name="SaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional.</param>
/// <param name="DownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not. Optional.</param>
/// <param name="ShouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not. Optional.</param>
/// <param name="ShouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional.</param>
[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
);
@@ -18,8 +18,9 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management;
/// <param name="CoverImage">The path of the image file used as the cover for the library. Optional.</param>
/// <param name="IsEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed. Optional.</param>
/// <param name="IsLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. Optional.</param>
/// <param name="DownloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not. Optional.</param>
/// <param name="SaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// <param name="DownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not. Optional.</param>
/// <param name="ShouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// <param name="ShouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not. Optional.</param>
[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
);
@@ -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
);
@@ -46,13 +46,16 @@ public class LibraryConfiguration : IEntityTypeConfiguration<LibraryEntity>
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<LibraryEntity>
// 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);
}
}
@@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lumina.DataAccess.Common.Migrations
{
/// <inheritdoc />
public partial class RenamesLibraryScanSettingsColumns : Migration
{
/// <inheritdoc />
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");
}
/// <inheritdoc />
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");
}
}
}
@@ -63,12 +63,18 @@ public class Library : AggregateRoot<LibraryId>
/// <summary>
/// Gets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMedatadaFromWeb { get; private set; } = true;
public bool DownloadMetadataFromWeb { get; private set; } = true;
/// <summary>
/// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool SaveMetadataInMediaDirectories { get; private set; }
public bool ShouldSaveMetadataInMediaDirectories { get; private set; }
/// <summary>
/// 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.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; private set; }
/// <summary>
/// Gets the list of objects representing the file system paths that make up the media library.
@@ -91,8 +97,9 @@ public class Library : AggregateRoot<LibraryId>
/// <param name="coverImage">The path of the image file used as the cover for the library.</param>
/// <param name="isEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed.</param>
/// <param name="isLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.</param>
/// <param name="downloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="saveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
private Library(
LibraryId id,
@@ -103,8 +110,9 @@ public class Library : AggregateRoot<LibraryId>
string? coverImage,
bool isEnabled,
bool isLocked,
bool downloadMedatadaFromWeb,
bool saveMetadataInMediaDirectories,
bool downloadMetadataFromWeb,
bool shouldSaveMetadataInMediaDirectories,
bool shouldSkipUnchangedDirectoriesDuringScan,
List<ScanId> scanIds) : base(id)
{
UserId = userId;
@@ -114,8 +122,9 @@ public class Library : AggregateRoot<LibraryId>
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<LibraryId>
/// <param name="coverImageSourcePath">The path of the image file chosen by the user to be used as the cover for the library.</param>
/// <param name="isEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed.</param>
/// <param name="isLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.</param>
/// <param name="downloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="saveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Library"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Library"/>, or an error message.
/// </returns>
public static ErrorOr<Library> Create(
UserId userId,
@@ -143,8 +153,9 @@ public class Library : AggregateRoot<LibraryId>
string? coverImageSourcePath,
bool isEnabled,
bool isLocked,
bool downloadMedatadaFromWeb,
bool saveMetadataInMediaDirectories,
bool downloadMetadataFromWeb,
bool shouldSaveMetadataInMediaDirectories,
bool shouldSkipUnchangedDirectoriesDuringScan,
List<ScanId> scanIds)
{
List<FileSystemPathId> tempContentLocations = [];
@@ -165,8 +176,9 @@ public class Library : AggregateRoot<LibraryId>
coverImageSourcePath,
isEnabled,
isLocked,
downloadMedatadaFromWeb,
saveMetadataInMediaDirectories,
downloadMetadataFromWeb,
shouldSaveMetadataInMediaDirectories,
shouldSkipUnchangedDirectoriesDuringScan,
scanIds
);
}
@@ -182,11 +194,12 @@ public class Library : AggregateRoot<LibraryId>
/// <param name="coverImageSourcePath">The path of the image file chosen by the user to be used as the cover for the library.</param>
/// <param name="isEnabled">Whether this media library is enabled or not. A disabled media library is never shown or changed.</param>
/// <param name="isLocked">Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.</param>
/// <param name="downloadMedatadaFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="saveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Library"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Library"/>, or an error message.
/// </returns>
public static ErrorOr<Library> Create(
LibraryId id,
@@ -197,8 +210,9 @@ public class Library : AggregateRoot<LibraryId>
string? coverImageSourcePath,
bool isEnabled,
bool isLocked,
bool downloadMedatadaFromWeb,
bool saveMetadataInMediaDirectories,
bool downloadMetadataFromWeb,
bool shouldSaveMetadataInMediaDirectories,
bool shouldSkipUnchangedDirectoriesDuringScan,
List<ScanId> scanIds)
{
List<FileSystemPathId> tempContentLocations = [];
@@ -219,8 +233,9 @@ public class Library : AggregateRoot<LibraryId>
coverImageSourcePath,
isEnabled,
isLocked,
downloadMedatadaFromWeb,
saveMetadataInMediaDirectories,
downloadMetadataFromWeb,
shouldSaveMetadataInMediaDirectories,
shouldSkipUnchangedDirectoriesDuringScan,
scanIds
);
}
@@ -34,8 +34,9 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
CoverImage: "/media/posters/myPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false
);
RequestParam(r => r.Title, "The title of the media library. Required.");
@@ -44,8 +45,9 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
RequestParam(r => 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<LibraryResponse>(r => r.Id, "The unique identifier of the entity.");
ResponseParam<LibraryResponse>(r => r.UserId, "The unique identifier of the user owning the media library.");
@@ -55,12 +57,13 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
ResponseParam<LibraryResponse>(r => r.CoverImage, "The path of the image file used as the cover for the library.");
ResponseParam<LibraryResponse>(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed.");
ResponseParam<LibraryResponse>(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.");
ResponseParam<LibraryResponse>(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(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<LibraryResponse>(r => r.CreatedOnUtc, "The date and time when the entity was created.");
ResponseParam<LibraryResponse>(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<AddLibraryEndpoint, AddLibraryR
CoverImage: "/media/myPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
));
@@ -33,8 +33,9 @@ public class GetEnabledLibrariesEndpointSummary : Summary<GetEnabledLibrariesEnd
CoverImage: "/media/myTvShowPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
),
@@ -47,8 +48,9 @@ public class GetEnabledLibrariesEndpointSummary : Summary<GetEnabledLibrariesEnd
CoverImage: "/media/myMoviePoster.jpg",
IsEnabled: true,
IsLocked: true,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: true,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: true,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
)
@@ -33,8 +33,9 @@ public class GetLibrariesEndpointSummary : Summary<GetLibrariesEndpoint, EmptyRe
CoverImage: "/media/myTvShowPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
),
@@ -47,8 +48,9 @@ public class GetLibrariesEndpointSummary : Summary<GetLibrariesEndpoint, EmptyRe
CoverImage: "/media/myMoviePoster.jpg",
IsEnabled: true,
IsLocked: true,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: true,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: true,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
)
@@ -38,8 +38,9 @@ public class GetLibraryEndpointSummary : Summary<GetLibraryEndpoint, GetLibraryR
ResponseParam<LibraryResponse>(r => r.CoverImage, "The path of the image file used as the cover for the library.");
ResponseParam<LibraryResponse>(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed.");
ResponseParam<LibraryResponse>(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.");
ResponseParam<LibraryResponse>(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(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<LibraryResponse>(r => r.CreatedOnUtc, "The date and time when the entity was created.");
ResponseParam<LibraryResponse>(r => r.UpdatedOnUtc, "The date and time when the entity was last updated.");
@@ -52,8 +53,9 @@ public class GetLibraryEndpointSummary : Summary<GetLibraryEndpoint, GetLibraryR
CoverImage: "/media/myPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
));
@@ -36,8 +36,9 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
CoverImage: "/media/posters/myPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false
);
RequestParam(r => r.Id, "The unique identifier of the media library. Required.");
@@ -48,8 +49,9 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
RequestParam(r => 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<LibraryResponse>(r => r.Id, "The unique identifier of the entity.");
ResponseParam<LibraryResponse>(r => r.UserId, "The unique identifier of the user owning the media library.");
@@ -59,12 +61,13 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
ResponseParam<LibraryResponse>(r => r.CoverImage, "The path of the image file used as the cover for the library.");
ResponseParam<LibraryResponse>(r => r.IsEnabled, "Whether this media library is enabled or not. A disabled media library is never shown or changed.");
ResponseParam<LibraryResponse>(r => r.IsLocked, "Whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.");
ResponseParam<LibraryResponse>(r => r.DownloadMedatadaFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.SaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(r => r.DownloadMetadataFromWeb, "Whether this media library should update the metadata of its elements from the web, or not.");
ResponseParam<LibraryResponse>(r => r.ShouldSaveMetadataInMediaDirectories, "Whether this media library should copy the downloaded metadata into the media library content locations, or not.");
ResponseParam<LibraryResponse>(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<LibraryResponse>(r => r.CreatedOnUtc, "The date and time when the entity was created.");
ResponseParam<LibraryResponse>(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<UpdateLibraryEndpoint, Updat
CoverImage: "/media/myPoster.jpg",
IsEnabled: true,
IsLocked: false,
DownloadMedatadaFromWeb: true,
SaveMetadataInMediaDirectories: false,
DownloadMetadataFromWeb: true,
ShouldSaveMetadataInMediaDirectories: false,
ShouldSkipUnchangedDirectoriesDuringScan: false,
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: default
));
@@ -56,10 +56,16 @@ public class LibraryModel
/// <summary>
/// Gets or sets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMedatadaFromWeb { get; set; } = true;
public bool DownloadMetadataFromWeb { get; set; } = true;
/// <summary>
/// Gets or sets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool SaveMetadataInMediaDirectories { get; set; } = false;
public bool ShouldSaveMetadataInMediaDirectories { get; set; } = false;
/// <summary>
/// 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.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; set; } = false;
}
@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 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 {
/// <summary>
/// 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..
/// </summary>
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 {
/// <summary>
/// Looks up a localized string similar to Save Metadata In Media Directories.
/// </summary>
public static string SaveMetadataInMediaDirectories {
public static string ShouldSaveMetadataInMediaDirectories {
get {
return ResourceManager.GetString("SaveMetadataInMediaDirectories", resourceCulture);
return ResourceManager.GetString("ShouldSaveMetadataInMediaDirectories", resourceCulture);
}
}
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Ob diese Medienbibliothek gesperrt ist oder nicht. Eine gesperrte Bibliothek wird den Benutzern angezeigt, wird aber nie gescannt, aktualisiert, verändert, usw.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Eine Bezeichnung für diese Bibliothek</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Speichern</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Metadaten In Medienverzeichnissen Speichern</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Unveränderte Ordner Beim Scannen Überspringen</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Drehbuch</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Whether this media library is locked or not. A locked library is displayed to the users, but it is never scanned, updated, modified, etc.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>A name to identify this library</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Save Metadata In Media Directories</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Skip Unchanged Directories During Scan</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Screenplay</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Si esta biblioteca multimedia está bloqueada o no. Una biblioteca bloqueada se muestra a los usuarios, pero nunca se escanea, actualiza, modifica, etc.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Un nombre para identificar esta biblioteca</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Guardar</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Guardar Metadatos En Los Directorios Multimedia</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Omitir Carpetas Sin Cambios Durante El Escaneo</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Guión</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Un nom pour identifier cette bibliothèque</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Enregistrer</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Sauvegarder Les Métadonnées Dans Les Répertoires Média</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Ignorer Les Dossiers Inchangés Lors De L'Analyse</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Scénario</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Se questa libreria multimediale è bloccata o meno. Una libreria bloccata viene mostrata agli utenti, ma non viene mai scansionata, aggiornata, modificata, ecc.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Un nome per identificare questa biblioteca</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Salva</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Salvare I Metadati Nelle Directory Multimediali</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Salta Cartelle Invariate Durante La Scansione</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Sceneggiatura</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>このメディアライブラリがロックされているかどうか。ロックされたライブラリはユーザーに表示されますが、スキャン、更新、変更などは一切されません。</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>ダウンロードしたメタデータのコピーをメディアライブラリのコンテンツディレクトリに保存するかどうか。これはウェブからのメタデータのダウンロードが有効な場合のみ効果があります。</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>このオプションを有効にすると、ディレクトリのメタデータを使用して、前回のスキャン以降に変更されていないディレクトリをスキップします。これによりスキャンを_大幅に_高速化できますが、既存のファイルを編集してもディレクトリのメタデータは_変更/更新されない_ことに注意してください。変更されるのは、新しいファイルを追加したときや既存のファイルを削除したときだけです。既存のファイルを変更しない場合にのみ有効にしてください。</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>この図書館を識別するための名称</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>保存</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>メディアディレクトリにメタデータを保存</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>スキャン中に変更のないフォルダをスキップ</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>脚本</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Whether this media library is locked or not. A locked library is displayed to the users, but it is never scanned, updated, modified, etc.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>A name to identify this library</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Save Metadata In Media Directories</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Skip Unchanged Directories During Scan</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Screenplay</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Dacă această bibliotecă media este blocată sau nu. O bibliotecă blocată este afișată utilizatorilor, dar nu este niciodată scanată, actualizată, modificată, etc.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>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ă.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>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.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Un nume pentru identificarea acestei biblioteci</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Salvează</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Salvează Metadatele În Directoarele Media</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Sari Peste Directorarele Neschimbate În Timpul Scanării</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Scenariu</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>Заблокирована эта медиатека или нет. Заблокированная библиотека отображается пользователям, но никогда не сканируется, не обновляется, не изменяется и т.д.</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Сохранять копию загруженных метаданных в каталогах содержимого медиатеки или нет. Это действует только если активна загрузка метаданных из интернета.</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>При включении этой опции используются метаданные каталогов, чтобы пропускать каталоги, не изменявшиеся с момента последнего сканирования. Это может _значительно_ ускорить сканирование, но учтите, что метаданные каталогов _не_ изменяются/обновляются при редактировании существующих файлов, а только при добавлении новых или удалении существующих. Включайте эту опцию только в том случае, если вы не изменяете существующие файлы.</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>Название для этой библиотеки</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>Сохранить</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>Сохранить Метаданные В Каталогах Медиафайлов</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>Пропускать Неизмененные Папки При Сканировании</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>Сценарий</value>
</data>
@@ -183,9 +183,12 @@
<data name="DescriptionLocked" xml:space="preserve">
<value>此媒体库是否已锁定。锁定的库会显示给用户,但永远不会被扫描、更新、修改等。</value>
</data>
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
<data name="DescriptionShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>是否在媒体库内容位置目录中保存已下载元数据的副本。这仅在从网络下载元数据处于活动状态时才有效。</value>
</data>
<data name="DescriptionShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>启用此选项后,将使用目录元数据跳过自上次扫描以来未更改的目录。这可以_显著_加快扫描速度,但请注意,编辑现有文件时目录元数据_不会_更改/更新,只有在添加新文件或删除现有文件时才会更改。仅当您不修改现有文件时才启用此选项。</value>
</data>
<data name="DescriptionTitle" xml:space="preserve">
<value>给这个图书馆起个名字</value>
</data>
@@ -273,9 +276,12 @@
<data name="Save" xml:space="preserve">
<value>保存</value>
</data>
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
<data name="ShouldSaveMetadataInMediaDirectories" xml:space="preserve">
<value>在媒体目录中保存元数据</value>
</data>
<data name="ShouldSkipUnchangedDirectoriesDuringScan" xml:space="preserve">
<value>扫描时跳过未更改的文件夹</value>
</data>
<data name="Screenplay" xml:space="preserve">
<value>剧本</value>
</data>
@@ -170,11 +170,11 @@
</div>
<div class="form-row">
<div class="form-label">
<label asp-for="DownloadMedatadaFromWeb">@_localizer["DownloadMetadataFromWeb"]</label>:
<label asp-for="DownloadMetadataFromWeb">@_localizer["DownloadMetadataFromWeb"]</label>:
</div>
<div class="form-field">
<label class="enlightenment-checkbox-label">
<input type="checkbox" asp-for="DownloadMedatadaFromWeb" class="enlightenment-checkbox-hidden"/>
<input type="checkbox" asp-for="DownloadMetadataFromWeb" class="enlightenment-checkbox-hidden"/>
<span class="enlightenment-checkbox"></span>
</label>
</div>
@@ -182,15 +182,27 @@
</div>
<div class="form-row">
<div class="form-label">
<label asp-for="SaveMetadataInMediaDirectories">@_localizer["SaveMetadataInMediaDirectories"]:</label>
<label asp-for="ShouldSaveMetadataInMediaDirectories">@_localizer["ShouldSaveMetadataInMediaDirectories"]:</label>
</div>
<div class="form-field">
<label class="enlightenment-checkbox-label">
<input type="checkbox" asp-for="SaveMetadataInMediaDirectories" class="enlightenment-checkbox-hidden" />
<input type="checkbox" asp-for="ShouldSaveMetadataInMediaDirectories" class="enlightenment-checkbox-hidden" />
<span class="enlightenment-checkbox"></span>
</label>
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionSaveMetadataInMediaDirectories"]</small>
<small class="form-label text-disabled form-description">@_localizer["DescriptionShouldSaveMetadataInMediaDirectories"]</small>
</div>
<div class="form-row">
<div class="form-label">
<label asp-for="ShouldSkipUnchangedDirectoriesDuringScan">@_localizer["ShouldSkipUnchangedDirectoriesDuringScan"]:</label>
</div>
<div class="form-field">
<label class="enlightenment-checkbox-label">
<input type="checkbox" asp-for="ShouldSkipUnchangedDirectoriesDuringScan" class="enlightenment-checkbox-hidden" />
<span class="enlightenment-checkbox"></span>
</label>
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionShouldSkipUnchangedDirectoriesDuringScan"]</small>
</div>
<div class="form-row">
<button type="submit" class="confirm-button w-100px">@_localizer["Save"]</button>
@@ -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) {
@@ -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
);
@@ -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;
@@ -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<Guid>? scanIds = null)
{
ErrorOr<Library> 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()]
);