mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 01:01:10 +00:00
Merge pull request #110 from BinaryAlley/feature/add-media-library-advanced-options
Adds media library advanced options
This commit is contained in:
60 files changed
+1877
-51
No files matched your search
+20
@@ -45,6 +45,26 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public required ICollection<LibraryContentLocationEntity> ContentLocations { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether this media library is enabled or not. A disabled media library is never shown or changed.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether this media library should update the metadata of its elements from the web, or not.
|
||||
/// </summary>
|
||||
public bool DownloadMedatadaFromWeb { 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; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user that owns the media library.
|
||||
/// </summary>
|
||||
|
||||
+17
@@ -1,8 +1,12 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Repositories.MediaLibrary;
|
||||
@@ -17,4 +21,17 @@ public interface ILibraryRepository : IRepository<LibraryEntity>,
|
||||
IUpdateRepositoryAction<LibraryEntity>,
|
||||
IDeleteByIdRepositoryAction<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all media libraries that are marked as enabled and unlocked, from the storage medium.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
|
||||
Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAndUnlockedAsync(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all media libraries that are marked as enabled from the storage medium.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
|
||||
Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
+5
-1
@@ -24,7 +24,11 @@ public static class AddMediaLibraryRequestMapping
|
||||
request.Title,
|
||||
request.LibraryType,
|
||||
request.ContentLocations,
|
||||
request.CoverImage
|
||||
request.CoverImage,
|
||||
request.IsEnabled,
|
||||
request.IsLocked,
|
||||
request.DownloadMedatadaFromWeb,
|
||||
request.SaveMetadataInMediaDirectories
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -29,6 +29,10 @@ public static class LibraryEntityMapping
|
||||
repositoryEntity.LibraryType,
|
||||
repositoryEntity.ContentLocations.Select(location => location.Path).ToList(),
|
||||
repositoryEntity.CoverImage,
|
||||
repositoryEntity.IsEnabled,
|
||||
repositoryEntity.IsLocked,
|
||||
repositoryEntity.DownloadMedatadaFromWeb,
|
||||
repositoryEntity.SaveMetadataInMediaDirectories,
|
||||
repositoryEntity.CreatedOnUtc,
|
||||
repositoryEntity.UpdatedOnUtc
|
||||
);
|
||||
@@ -47,7 +51,11 @@ public static class LibraryEntityMapping
|
||||
repositoryEntity.Title,
|
||||
repositoryEntity.LibraryType,
|
||||
repositoryEntity.ContentLocations.Select(contentLocation => contentLocation.Path),
|
||||
repositoryEntity.CoverImage
|
||||
repositoryEntity.CoverImage,
|
||||
repositoryEntity.IsEnabled,
|
||||
repositoryEntity.IsLocked,
|
||||
repositoryEntity.DownloadMedatadaFromWeb,
|
||||
repositoryEntity.SaveMetadataInMediaDirectories
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ public static class LibraryMapping
|
||||
UserId = domainEntity.UserId.Value,
|
||||
ContentLocations = domainEntity.ContentLocations.Select(path => new LibraryContentLocationEntity() { Path = path.Path }).ToList(),
|
||||
CoverImage = domainEntity.CoverImage,
|
||||
IsEnabled = domainEntity.IsEnabled,
|
||||
IsLocked = domainEntity.IsLocked,
|
||||
DownloadMedatadaFromWeb = domainEntity.DownloadMedatadaFromWeb,
|
||||
SaveMetadataInMediaDirectories = domainEntity.SaveMetadataInMediaDirectories,
|
||||
CreatedOnUtc = domainEntity.CreatedOnUtc,
|
||||
CreatedBy = Guid.Empty,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc : null,
|
||||
|
||||
+5
-1
@@ -24,7 +24,11 @@ public static class UpdateLibraryRequestMapping
|
||||
request.Title,
|
||||
request.LibraryType,
|
||||
request.ContentLocations,
|
||||
request.CoverImage
|
||||
request.CoverImage,
|
||||
request.IsEnabled,
|
||||
request.IsLocked,
|
||||
request.DownloadMedatadaFromWeb,
|
||||
request.SaveMetadataInMediaDirectories
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -15,10 +15,18 @@ namespace Lumina.Application.Core.MediaLibrary.Management.Commands.AddLibrary;
|
||||
/// <param name="LibraryType">The type of the media library.</param>
|
||||
/// <param name="ContentLocations">The file system paths of the directories where the media library elements are located.</param>
|
||||
/// <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>
|
||||
[DebuggerDisplay("Title: {Title}")]
|
||||
public record AddLibraryCommand(
|
||||
string? Title,
|
||||
string? LibraryType,
|
||||
string[]? ContentLocations,
|
||||
string? CoverImage
|
||||
string? CoverImage,
|
||||
bool IsEnabled,
|
||||
bool IsLocked,
|
||||
bool DownloadMedatadaFromWeb,
|
||||
bool SaveMetadataInMediaDirectories
|
||||
) : IRequest<ErrorOr<LibraryResponse>>;
|
||||
+11
-6
@@ -68,6 +68,12 @@ public class AddLibraryCommandHandler : IRequestHandler<AddLibraryCommand, Error
|
||||
/// </returns>
|
||||
public async ValueTask<ErrorOr<LibraryResponse>> Handle(AddLibraryCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
// if the user that made the request is not an Admin or they don't have the permission to manage media libraries, they do not have the right to create it
|
||||
if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false) &&
|
||||
!await _authorizationService.HasPermissionAsync(_currentUserService.UserId!.Value, AuthorizationPermission.CanCreateLibraries, cancellationToken).ConfigureAwait(false))
|
||||
return ApplicationErrors.Authorization.NotAuthorized;
|
||||
|
||||
// make sure the file is an actual supported image
|
||||
if (request.CoverImage is not null)
|
||||
{
|
||||
@@ -88,14 +94,13 @@ public class AddLibraryCommandHandler : IRequestHandler<AddLibraryCommand, Error
|
||||
request.Title!,
|
||||
Enum.Parse<LibraryType>(request.LibraryType!),
|
||||
request.ContentLocations!,
|
||||
request.CoverImage
|
||||
request.CoverImage,
|
||||
request.IsEnabled,
|
||||
request.IsLocked,
|
||||
request.DownloadMedatadaFromWeb,
|
||||
request.SaveMetadataInMediaDirectories
|
||||
);
|
||||
|
||||
// if the user that made the request is not an Admin or they don't have the permission to manage media libraries, they do not have the right to create it
|
||||
if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false) &&
|
||||
!await _authorizationService.HasPermissionAsync(_currentUserService.UserId!.Value, AuthorizationPermission.CanCreateLibraries, cancellationToken).ConfigureAwait(false))
|
||||
return ApplicationErrors.Authorization.NotAuthorized;
|
||||
|
||||
if (createLibraryResult.IsError)
|
||||
return createLibraryResult.Errors;
|
||||
|
||||
|
||||
+2
-2
@@ -58,9 +58,9 @@ public class ScanLibrariesCommandHandler : IRequestHandler<ScanLibrariesCommand,
|
||||
if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false))
|
||||
return Errors.Authorization.NotAuthorized;
|
||||
|
||||
// get all media libraries from the persistence medium
|
||||
// get all media libraries that are enabled and unlocked from the persistence medium
|
||||
ILibraryRepository libraryRepository = _unitOfWork.GetRepository<ILibraryRepository>();
|
||||
ErrorOr<IEnumerable<LibraryEntity>> getLibrariesResult = await libraryRepository.GetAllAsync(cancellationToken).ConfigureAwait(false);
|
||||
ErrorOr<IEnumerable<LibraryEntity>> getLibrariesResult = await libraryRepository.GetAllEnabledAndUnlockedAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (getLibrariesResult.IsError)
|
||||
return getLibrariesResult.Errors;
|
||||
|
||||
|
||||
+9
-1
@@ -17,6 +17,10 @@ namespace Lumina.Application.Core.MediaLibrary.Management.Commands.UpdateLibrary
|
||||
/// <param name="LibraryType">The type of the media library.</param>
|
||||
/// <param name="ContentLocations">The file system paths of the directories where the media library elements are located.</param>
|
||||
/// <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>
|
||||
[DebuggerDisplay("Title: {Title}")]
|
||||
public record UpdateLibraryCommand(
|
||||
Guid Id,
|
||||
@@ -24,5 +28,9 @@ public record UpdateLibraryCommand(
|
||||
string? Title,
|
||||
string? LibraryType,
|
||||
string[]? ContentLocations,
|
||||
string? CoverImage
|
||||
string? CoverImage,
|
||||
bool IsEnabled,
|
||||
bool IsLocked,
|
||||
bool DownloadMedatadaFromWeb,
|
||||
bool SaveMetadataInMediaDirectories
|
||||
) : IRequest<ErrorOr<LibraryResponse>>;
|
||||
+5
-1
@@ -103,7 +103,11 @@ public class UpdateLibraryCommandHandler : IRequestHandler<UpdateLibraryCommand,
|
||||
request.Title!,
|
||||
Enum.Parse<LibraryType>(request.LibraryType!),
|
||||
request.ContentLocations!,
|
||||
request.CoverImage
|
||||
request.CoverImage,
|
||||
request.IsEnabled,
|
||||
request.IsLocked,
|
||||
request.DownloadMedatadaFromWeb,
|
||||
request.SaveMetadataInMediaDirectories
|
||||
);
|
||||
if (createLibraryResult.IsError)
|
||||
return createLibraryResult.Errors;
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Contracts.Responses.MediaLibrary.Management;
|
||||
using Mediator;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Core.MediaLibrary.Management.Queries.GetEnabledLibraries;
|
||||
|
||||
/// <summary>
|
||||
/// Query for getting the list of enabled media libraries.
|
||||
/// </summary>
|
||||
public record GetEnabledLibrariesQuery : IRequest<ErrorOr<LibraryResponse[]>>;
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.MediaLibrary;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
using Lumina.Application.Common.Infrastructure.Authentication;
|
||||
using Lumina.Application.Common.Infrastructure.Authorization;
|
||||
using Lumina.Application.Common.Mapping.MediaLibrary.Management;
|
||||
using Lumina.Contracts.Responses.MediaLibrary.Management;
|
||||
using Mediator;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Core.MediaLibrary.Management.Queries.GetEnabledLibraries;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for the query to get the enabled media libraries.
|
||||
/// </summary>
|
||||
public class GetEnabledLibrariesQueryHandler : IRequestHandler<GetEnabledLibrariesQuery, ErrorOr<LibraryResponse[]>>
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
private readonly ICurrentUserService _currentUserService;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetEnabledLibrariesQueryHandler"/> class.
|
||||
/// </summary>
|
||||
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
|
||||
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
|
||||
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
|
||||
public GetEnabledLibrariesQueryHandler(
|
||||
IAuthorizationService authorizationService,
|
||||
ICurrentUserService currentUserService,
|
||||
IUnitOfWork unitOfWork)
|
||||
{
|
||||
_authorizationService = authorizationService;
|
||||
_currentUserService = currentUserService;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the query to get the enabled media libraries.
|
||||
/// </summary>
|
||||
/// <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.
|
||||
/// </returns>
|
||||
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetEnabledLibrariesQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
// get the enabled libraries from the repository
|
||||
ILibraryRepository libraryRepository = _unitOfWork.GetRepository<ILibraryRepository>();
|
||||
ErrorOr<IEnumerable<LibraryEntity>> getEnabledLibrariesResult = await libraryRepository.GetAllEnabledAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (getEnabledLibrariesResult.IsError)
|
||||
return getEnabledLibrariesResult.Errors;
|
||||
|
||||
// admins can see all libraries
|
||||
if (await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false))
|
||||
return ErrorOrFactory.From(getEnabledLibrariesResult.Value.Select(library => library.ToResponse()).ToArray());
|
||||
else
|
||||
{
|
||||
// for regular users, only take the libraries that belong to them
|
||||
LibraryResponse[] userEnabledLibraries = getEnabledLibrariesResult.Value
|
||||
.Where(library => library.UserId == _currentUserService.UserId)
|
||||
.Select(library => library.ToResponse()).ToArray();
|
||||
|
||||
return ErrorOrFactory.From(userEnabledLibraries);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -17,7 +17,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Application.Core.MediaLibrary.Management.Queries.GetLibraries;
|
||||
|
||||
/// <summary>
|
||||
/// Handler for the query to authenticate an account.
|
||||
/// Handler for the query to get the media libraries.
|
||||
/// </summary>
|
||||
public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, ErrorOr<LibraryResponse[]>>
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the query to authenticate an account.
|
||||
/// Handles the query to get the media libraries.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be handled.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
@@ -51,7 +51,7 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
|
||||
/// </returns>
|
||||
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetLibrariesQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
// get the library with the specified id from the repository
|
||||
// get the libraries from the repository
|
||||
ILibraryRepository libraryRepository = _unitOfWork.GetRepository<ILibraryRepository>();
|
||||
ErrorOr<IEnumerable<LibraryEntity>> getLibrariesResult = await libraryRepository.GetAllAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (getLibrariesResult.IsError)
|
||||
|
||||
+5
-2
@@ -42,9 +42,12 @@ internal class BookLibraryTypeScanner : IBookLibraryTypeScanner
|
||||
|
||||
hashComparerJob.AddParent(fileSystemDiscoveryJob);
|
||||
hashComparerJob.AddParent(repositoryMetadataDiscoveryJob);
|
||||
hashComparerJob.AddChild(goodReadsMetadataScrapJob);
|
||||
|
||||
goodReadsMetadataScrapJob.AddParent(hashComparerJob);
|
||||
if (library.DownloadMedatadaFromWeb)
|
||||
{
|
||||
hashComparerJob.AddChild(goodReadsMetadataScrapJob);
|
||||
goodReadsMetadataScrapJob.AddParent(hashComparerJob);
|
||||
}
|
||||
|
||||
// return the top level jobs that will be triggered when the scan will be started
|
||||
yield return fileSystemDiscoveryJob;
|
||||
|
||||
@@ -11,10 +11,18 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
/// <param name="LibraryType">The type of the media library. Required.</param>
|
||||
/// <param name="ContentLocations">The file system paths of the directories where the media library elements are located. Required.</param>
|
||||
/// <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>
|
||||
[DebuggerDisplay("Title: {Title}")]
|
||||
public record AddLibraryRequest(
|
||||
string? Title,
|
||||
string? LibraryType,
|
||||
string[]? ContentLocations,
|
||||
string? CoverImage
|
||||
string? CoverImage,
|
||||
bool IsEnabled,
|
||||
bool IsLocked,
|
||||
bool DownloadMedatadaFromWeb,
|
||||
bool SaveMetadataInMediaDirectories
|
||||
);
|
||||
@@ -16,6 +16,10 @@ namespace Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
/// <param name="LibraryType">The type of the media library. Required.</param>
|
||||
/// <param name="ContentLocations">The file system paths of the directories where the media library elements are located. Required.</param>
|
||||
/// <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.
|
||||
[DebuggerDisplay("Title: {Title}")]
|
||||
public record class UpdateLibraryRequest(
|
||||
Guid Id,
|
||||
@@ -23,5 +27,9 @@ public record class UpdateLibraryRequest(
|
||||
string? Title,
|
||||
string? LibraryType,
|
||||
string[]? ContentLocations,
|
||||
string? CoverImage
|
||||
string? CoverImage,
|
||||
bool IsEnabled,
|
||||
bool IsLocked,
|
||||
bool DownloadMedatadaFromWeb,
|
||||
bool SaveMetadataInMediaDirectories
|
||||
);
|
||||
@@ -26,6 +26,10 @@ public record LibraryResponse(
|
||||
LibraryType LibraryType,
|
||||
List<string> ContentLocations,
|
||||
string? CoverImage,
|
||||
bool IsEnabled,
|
||||
bool IsLocked,
|
||||
bool DownloadMedatadaFromWeb,
|
||||
bool SaveMetadataInMediaDirectories,
|
||||
DateTime CreatedOnUtc,
|
||||
DateTime? UpdatedOnUtc
|
||||
);
|
||||
@@ -39,6 +39,20 @@ public class LibraryConfiguration : IEntityTypeConfiguration<LibraryEntity>
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(3);
|
||||
|
||||
builder.Property(library => library.IsEnabled)
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(4);
|
||||
|
||||
builder.Property(library => library.IsLocked)
|
||||
.HasColumnOrder(5);
|
||||
|
||||
builder.Property(library => library.DownloadMedatadaFromWeb)
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(6);
|
||||
|
||||
builder.Property(library => library.SaveMetadataInMediaDirectories)
|
||||
.HasColumnOrder(7);
|
||||
|
||||
// one user with many libraries
|
||||
builder.HasOne(library => library.User)
|
||||
.WithMany(user => user.Libraries)
|
||||
|
||||
Generated
+734
@@ -0,0 +1,734 @@
|
||||
// <auto-generated />
|
||||
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("20250124174632_AddsMediaLibraryAdvancedOptions")]
|
||||
partial class AddsMediaLibraryAdvancedOptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.0");
|
||||
|
||||
modelBuilder.Entity("BookGenres", b =>
|
||||
{
|
||||
b.Property<Guid>("BookId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("GenreId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("BookId", "GenreId");
|
||||
|
||||
b.HasIndex("GenreId");
|
||||
|
||||
b.ToTable("BookGenres", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BookTags", b =>
|
||||
{
|
||||
b.Property<Guid>("BookId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("PermissionName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<DateTime?>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<DateTime?>("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<Guid>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("PermissionId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<DateTime?>("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<Guid>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("PermissionId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<DateTime?>("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<Guid>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<DateTime?>("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<string>("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<string>("Name")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("Tags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("CoverImage")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("DownloadMedatadaFromWeb")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<bool>("IsLocked")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<string>("LibraryType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<bool>("SaveMetadataInMediaDirectories")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("UpdatedOnUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Libraries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("ASIN")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(21);
|
||||
|
||||
b.Property<string>("AppleBooksId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(29);
|
||||
|
||||
b.Property<string>("BarnesAndNobleId")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(28);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(30);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("Edition")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(19);
|
||||
|
||||
b.Property<string>("Format")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(18);
|
||||
|
||||
b.Property<string>("GoodreadsId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(22);
|
||||
|
||||
b.Property<string>("GoogleBooksId")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(27);
|
||||
|
||||
b.Property<string>("LCCN")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(23);
|
||||
|
||||
b.Property<string>("LanguageCode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(10);
|
||||
|
||||
b.Property<string>("LanguageName")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(11);
|
||||
|
||||
b.Property<string>("LanguageNativeName")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(12);
|
||||
|
||||
b.Property<string>("LibraryThingId")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(26);
|
||||
|
||||
b.Property<string>("OCLCNumber")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(24);
|
||||
|
||||
b.Property<string>("OpenLibraryId")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(25);
|
||||
|
||||
b.Property<string>("OriginalLanguageCode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(13);
|
||||
|
||||
b.Property<string>("OriginalLanguageName")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(14);
|
||||
|
||||
b.Property<string>("OriginalLanguageNativeName")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(15);
|
||||
|
||||
b.Property<DateOnly?>("OriginalReleaseDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int?>("OriginalReleaseYear")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int?>("PageCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(17);
|
||||
|
||||
b.Property<string>("Publisher")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(16);
|
||||
|
||||
b.Property<DateOnly?>("ReReleaseDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<int?>("ReReleaseYear")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("ReleaseCountry")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<string>("ReleaseVersion")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("UpdatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(31);
|
||||
|
||||
b.Property<int?>("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<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<string>("TempPassword")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<DateTime?>("TempPasswordCreated")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<string>("TotpSecret")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.Property<DateTime?>("UpdatedOnUtc")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<string>("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.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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<Guid>("LibraryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<string>("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.WrittenContentLibrary.BookLibrary.BookEntity", b =>
|
||||
{
|
||||
b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookRatingEntity", "Ratings", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<Guid>("BookId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<decimal>("MaxValue")
|
||||
.HasColumnType("decimal(3,2)");
|
||||
|
||||
b1.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<decimal>("Value")
|
||||
.HasColumnType("decimal(3,2)");
|
||||
|
||||
b1.Property<int?>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<Guid>("BookId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<string>("Format")
|
||||
.IsRequired()
|
||||
.HasMaxLength(6)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<string>("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.UsersManagement.UserEntity", b =>
|
||||
{
|
||||
b.Navigation("Libraries");
|
||||
|
||||
b.Navigation("UserPermissions");
|
||||
|
||||
b.Navigation("UserRole");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lumina.DataAccess.Common.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddsMediaLibraryAdvancedOptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DownloadMedatadaFromWeb",
|
||||
table: "Libraries",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: true)
|
||||
.Annotation("Relational:ColumnOrder", 6);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsEnabled",
|
||||
table: "Libraries",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: true)
|
||||
.Annotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsLocked",
|
||||
table: "Libraries",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false)
|
||||
.Annotation("Relational:ColumnOrder", 5);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SaveMetadataInMediaDirectories",
|
||||
table: "Libraries",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false)
|
||||
.Annotation("Relational:ColumnOrder", 7);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DownloadMedatadaFromWeb",
|
||||
table: "Libraries");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsEnabled",
|
||||
table: "Libraries");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsLocked",
|
||||
table: "Libraries");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SaveMetadataInMediaDirectories",
|
||||
table: "Libraries");
|
||||
}
|
||||
}
|
||||
@@ -256,11 +256,31 @@ namespace Lumina.DataAccess.Common.Migrations
|
||||
b.Property<DateTime>("CreatedOnUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("DownloadMedatadaFromWeb")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<bool>("IsLocked")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<string>("LibraryType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<bool>("SaveMetadataInMediaDirectories")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Lumina.Domain.Common.Errors;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
@@ -58,6 +59,32 @@ internal sealed class LibraryRepository : ILibraryRepository
|
||||
.FirstOrDefaultAsync(library => library.Id == id, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all media libraries that are marked as enabled, from the storage medium.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
|
||||
public async Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return await _luminaDbContext.Libraries
|
||||
.Include(library => library.ContentLocations)
|
||||
.Where(library => library.IsEnabled)
|
||||
.ToListAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all media libraries that are marked as enabled and unlocked, from the storage medium.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
|
||||
public async Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAndUnlockedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return await _luminaDbContext.Libraries
|
||||
.Include(library => library.ContentLocations)
|
||||
.Where(library => library.IsEnabled && !library.IsLocked)
|
||||
.ToListAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all media libraries.
|
||||
/// </summary>
|
||||
|
||||
+61
-6
@@ -47,6 +47,26 @@ public class Library : AggregateRoot<LibraryId>
|
||||
/// </summary>
|
||||
public string? CoverImageSourcePath { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether this media library is enabled or not. A disabled media library is never shown or changed.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; private set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; private set; }
|
||||
|
||||
/// <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;
|
||||
|
||||
/// <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; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of file system paths that make up the media library.
|
||||
/// </summary>
|
||||
@@ -61,20 +81,31 @@ public class Library : AggregateRoot<LibraryId>
|
||||
/// <param name="libraryType">The type of the media library (e.g., Book, TvShow).</param>
|
||||
/// <param name="contentLocations">The list of file system paths that make up the media library.</param>
|
||||
/// <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>
|
||||
private Library(
|
||||
LibraryId id,
|
||||
UserId userId,
|
||||
string title,
|
||||
LibraryType libraryType,
|
||||
List<FileSystemPathId> contentLocations,
|
||||
string? coverImage) : base(id)
|
||||
string? coverImage,
|
||||
bool isEnabled,
|
||||
bool isLocked,
|
||||
bool downloadMedatadaFromWeb,
|
||||
bool saveMetadataInMediaDirectories) : base(id)
|
||||
{
|
||||
UserId = userId;
|
||||
Title = title;
|
||||
LibraryType = libraryType;
|
||||
_contentLocations = contentLocations;
|
||||
CoverImage = coverImage;
|
||||
|
||||
IsEnabled = isEnabled;
|
||||
IsLocked = isLocked;
|
||||
DownloadMedatadaFromWeb = downloadMedatadaFromWeb;
|
||||
SaveMetadataInMediaDirectories = saveMetadataInMediaDirectories;
|
||||
_domainEvents.Add(new LibrarySavedDomainEvent(Guid.NewGuid(), this, DateTime.UtcNow));
|
||||
}
|
||||
|
||||
@@ -86,6 +117,10 @@ public class Library : AggregateRoot<LibraryId>
|
||||
/// <param name="libraryType">The type of the media library (e.g., Book, TvShow).</param>
|
||||
/// <param name="contentLocations">The list of file system paths that make up the media library.</param>
|
||||
/// <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>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Library"/>, or an error message.
|
||||
/// </returns>
|
||||
@@ -94,7 +129,11 @@ public class Library : AggregateRoot<LibraryId>
|
||||
string title,
|
||||
LibraryType libraryType,
|
||||
IEnumerable<string> contentLocations,
|
||||
string? coverImageSourcePath)
|
||||
string? coverImageSourcePath,
|
||||
bool isEnabled,
|
||||
bool isLocked,
|
||||
bool downloadMedatadaFromWeb,
|
||||
bool saveMetadataInMediaDirectories)
|
||||
{
|
||||
List<FileSystemPathId> tempContentLocations = [];
|
||||
// go through all the file system paths that make up the media library and create domain objects from them
|
||||
@@ -111,7 +150,11 @@ public class Library : AggregateRoot<LibraryId>
|
||||
title,
|
||||
libraryType,
|
||||
tempContentLocations,
|
||||
coverImageSourcePath
|
||||
coverImageSourcePath,
|
||||
isEnabled,
|
||||
isLocked,
|
||||
downloadMedatadaFromWeb,
|
||||
saveMetadataInMediaDirectories
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,6 +167,10 @@ public class Library : AggregateRoot<LibraryId>
|
||||
/// <param name="libraryType">The type of the media library (e.g., Book, TvShow).</param>
|
||||
/// <param name="contentLocations">The list of file system paths that make up the media library.</param>
|
||||
/// <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>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Library"/>, or an error message.
|
||||
/// </returns>
|
||||
@@ -133,7 +180,11 @@ public class Library : AggregateRoot<LibraryId>
|
||||
string title,
|
||||
LibraryType libraryType,
|
||||
IEnumerable<string> contentLocations,
|
||||
string? coverImageSourcePath)
|
||||
string? coverImageSourcePath,
|
||||
bool isEnabled,
|
||||
bool isLocked,
|
||||
bool downloadMedatadaFromWeb,
|
||||
bool saveMetadataInMediaDirectories)
|
||||
{
|
||||
List<FileSystemPathId> tempContentLocations = [];
|
||||
// go through all the file system paths that make up the media library and create domain objects from them
|
||||
@@ -150,7 +201,11 @@ public class Library : AggregateRoot<LibraryId>
|
||||
title,
|
||||
libraryType,
|
||||
tempContentLocations,
|
||||
coverImageSourcePath
|
||||
coverImageSourcePath,
|
||||
isEnabled,
|
||||
isLocked,
|
||||
downloadMedatadaFromWeb,
|
||||
saveMetadataInMediaDirectories
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ public static partial class ApiRoutes
|
||||
{
|
||||
public const string GET_LIBRARY_BY_ID = "/libraries/{id}";
|
||||
public const string GET_LIBRARIES = "/libraries";
|
||||
public const string GET_ENABLED_LIBRARIES = "/libraries/enabled";
|
||||
public const string ADD_LIBRARY = "/libraries";
|
||||
public const string UPDATE_LIBRARY = "/libraries/{id}";
|
||||
public const string DELETE_LIBRARY = "/libraries/{id}";
|
||||
|
||||
+17
-3
@@ -31,13 +31,21 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
|
||||
"/media/tv shows/drama/",
|
||||
"/media/tv shows/SCI-FI/",
|
||||
],
|
||||
CoverImage: "/media/posters/myPoster.jpg"
|
||||
CoverImage: "/media/posters/myPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false
|
||||
);
|
||||
|
||||
RequestParam(r => r.Title, "The title of the media library. Required.");
|
||||
RequestParam(r => r.LibraryType, "The type of the media library. Required.");
|
||||
RequestParam(r => r.ContentLocations, "The file system paths of the directories where the media library elements are located. Required.");
|
||||
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.");
|
||||
|
||||
ResponseParam<LibraryResponse>(r => r.Id, "The unique identifier of the entity.");
|
||||
ResponseParam<LibraryResponse>(r => r.UserId, "The Id of the user owning the media library.");
|
||||
@@ -45,10 +53,13 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
|
||||
ResponseParam<LibraryResponse>(r => r.LibraryType, "The type of the media library.");
|
||||
ResponseParam<LibraryResponse>(r => r.ContentLocations, "The file system paths of the directories where the media library elements are located.");
|
||||
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.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:
|
||||
new LibraryResponse(
|
||||
Id: Guid.NewGuid(),
|
||||
@@ -57,11 +68,14 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/tv shows/drama/", "/media/tv shows/SCI-FI/"],
|
||||
CoverImage: "/media/myPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
));
|
||||
|
||||
|
||||
Response(401, "Authentication required.", "application/problem+json",
|
||||
example: new[]
|
||||
{
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FastEndpoints;
|
||||
using Lumina.Application.Core.MediaLibrary.Management.Queries.GetEnabledLibraries;
|
||||
using Lumina.Contracts.Responses.MediaLibrary.Management;
|
||||
using Lumina.Presentation.Api.Common.Routes.Library.Management;
|
||||
using Lumina.Presentation.Api.Core.Endpoints.Common;
|
||||
using Mediator;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Library.Management.GetEnabledLibraries;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/libraries/enabled</c> route.
|
||||
/// </summary>
|
||||
public class GetEnabledLibrariesEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
{
|
||||
private readonly ISender _sender;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetEnabledLibrariesEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="sender">Injected service for mediating commands and queries.</param>
|
||||
public GetEnabledLibrariesEndpoint(ISender sender)
|
||||
{
|
||||
_sender = sender;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the API endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
Verbs(Http.GET);
|
||||
Routes(ApiRoutes.Libraries.GET_ENABLED_LIBRARIES);
|
||||
Version(1);
|
||||
DontCatchExceptions();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of enabled media libraries.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(EmptyRequest _, CancellationToken cancellationToken)
|
||||
{
|
||||
ErrorOr<LibraryResponse[]> result = await _sender.Send(new GetEnabledLibrariesQuery(), cancellationToken).ConfigureAwait(false);
|
||||
return result.Match(success => TypedResults.Ok(success), Problem);
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Contracts.Responses.MediaLibrary.Management;
|
||||
using Lumina.Domain.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Library.Management.GetEnabledLibraries;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="GetEnabledLibrariesEndpoint"/> API endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetEnabledLibrariesEndpointSummary : Summary<GetEnabledLibrariesEndpoint, EmptyRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetEnabledLibrariesEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public GetEnabledLibrariesEndpointSummary()
|
||||
{
|
||||
Summary = "Retrieves the list of enabled media libraries.";
|
||||
Description = "Retrieves the entire list of media libraries that are marked as enabled, if the user making the request is an Admin, or just the library owned by them, for regular users.";
|
||||
|
||||
Response(200, "The media libraries are returned.",
|
||||
example: new LibraryResponse[] {
|
||||
new (
|
||||
Id: Guid.NewGuid(),
|
||||
UserId: Guid.NewGuid(),
|
||||
Title: "TV Shows",
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/tv shows/drama/", "/media/tv shows/SCI-FI/"],
|
||||
CoverImage: "/media/myTvShowPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
),
|
||||
new (
|
||||
Id: Guid.NewGuid(),
|
||||
UserId: Guid.NewGuid(),
|
||||
Title: "Movies",
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/movies/"],
|
||||
CoverImage: "/media/myMoviePoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: true,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: true,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
)
|
||||
});
|
||||
|
||||
Response(401, "Authentication required.", "application/problem+json",
|
||||
example: new[]
|
||||
{
|
||||
new
|
||||
{
|
||||
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/libraries/enabled"
|
||||
},
|
||||
new
|
||||
{
|
||||
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/libraries/enabled"
|
||||
},
|
||||
new
|
||||
{
|
||||
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/libraries/enabled"
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -41,9 +41,8 @@ public class GetLibrariesEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of libraries.
|
||||
/// Gets the list of media libraries.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the id of the library to be retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(EmptyRequest _, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
+8
@@ -31,6 +31,10 @@ public class GetLibrariesEndpointSummary : Summary<GetLibrariesEndpoint, EmptyRe
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/tv shows/drama/", "/media/tv shows/SCI-FI/"],
|
||||
CoverImage: "/media/myTvShowPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
),
|
||||
@@ -41,6 +45,10 @@ public class GetLibrariesEndpointSummary : Summary<GetLibrariesEndpoint, EmptyRe
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/movies/"],
|
||||
CoverImage: "/media/myMoviePoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: true,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: true,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
)
|
||||
|
||||
+8
@@ -36,6 +36,10 @@ public class GetLibraryEndpointSummary : Summary<GetLibraryEndpoint, GetLibraryR
|
||||
ResponseParam<LibraryResponse>(r => r.LibraryType, "The type of the media library.");
|
||||
ResponseParam<LibraryResponse>(r => r.ContentLocations, "The file system paths of the directories where the media library elements are located.");
|
||||
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.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.");
|
||||
|
||||
@@ -46,6 +50,10 @@ public class GetLibraryEndpointSummary : Summary<GetLibraryEndpoint, GetLibraryR
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/tv shows/drama/", "/media/tv shows/SCI-FI/"],
|
||||
CoverImage: "/media/myPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
));
|
||||
|
||||
+18
-4
@@ -33,7 +33,11 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
|
||||
"/media/tv shows/drama/",
|
||||
"/media/tv shows/SCI-FI/",
|
||||
],
|
||||
CoverImage: "/media/posters/myPoster.jpg"
|
||||
CoverImage: "/media/posters/myPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false
|
||||
);
|
||||
|
||||
RequestParam(r => r.Id, "The Id of the media library. Required.");
|
||||
@@ -42,6 +46,10 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
|
||||
RequestParam(r => r.LibraryType, "The type of the media library. Required.");
|
||||
RequestParam(r => r.ContentLocations, ">The file system paths of the directories where the media library elements are located. Required.");
|
||||
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.");
|
||||
|
||||
ResponseParam<LibraryResponse>(r => r.Id, "The unique identifier of the entity.");
|
||||
ResponseParam<LibraryResponse>(r => r.UserId, "The Id of the user owning the media library.");
|
||||
@@ -49,10 +57,13 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
|
||||
ResponseParam<LibraryResponse>(r => r.LibraryType, "The type of the media library.");
|
||||
ResponseParam<LibraryResponse>(r => r.ContentLocations, "The file system paths of the directories where the media library elements are located.");
|
||||
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.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:
|
||||
new LibraryResponse(
|
||||
Id: Guid.NewGuid(),
|
||||
@@ -60,12 +71,15 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
|
||||
Title: "TV Shows",
|
||||
LibraryType: LibraryType.TvShow,
|
||||
ContentLocations: ["/media/tv shows/drama/", "/media/tv shows/SCI-FI/"],
|
||||
"/media/myPoster.jpg",
|
||||
CoverImage: "/media/myPoster.jpg",
|
||||
IsEnabled: true,
|
||||
IsLocked: false,
|
||||
DownloadMedatadaFromWeb: true,
|
||||
SaveMetadataInMediaDirectories: false,
|
||||
CreatedOnUtc: DateTime.UtcNow,
|
||||
UpdatedOnUtc: default
|
||||
));
|
||||
|
||||
|
||||
Response(401, "Authentication required.", "application/problem+json",
|
||||
example: new[]
|
||||
{
|
||||
|
||||
@@ -42,4 +42,24 @@ public class LibraryModel
|
||||
/// Gets or sets the collection of directories that contain the library files.
|
||||
/// </summary>
|
||||
public List<string> ContentLocations { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this media library is enabled or not. A disabled media library is never shown or changed.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; set; } = false;
|
||||
|
||||
/// <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;
|
||||
|
||||
/// <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;
|
||||
}
|
||||
+11
@@ -73,6 +73,17 @@ public class LibraryManagementController : Controller
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of enabled media libraries.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
[HttpGet("api-get-enabled-libraries")]
|
||||
public async Task<IActionResult> GetEnabledLibraries(CancellationToken cancellationToken = default)
|
||||
{
|
||||
LibraryModel[] response = await _apiHttpClient.GetAsync<LibraryModel[]>($"libraries/enabled/", cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new media library, or updates an existing one.
|
||||
/// </summary>
|
||||
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Keine Bibliotheken</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Entfernen</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>No libraries</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Remove</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Sin bibliotecas</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Eliminar</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Aucune bibliothèque</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Supprimer</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Nessuna libreria</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Rimuovere</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>ライブラリがありません</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>削除</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>No libraries</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Remove</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Nicio bibliotecă</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Șterge</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>Нет библиотек</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>Удалить</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,4 +132,7 @@
|
||||
<data name="NoLibraries" xml:space="preserve">
|
||||
<value>无库</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>删除</value>
|
||||
</data>
|
||||
</root>
|
||||
+81
@@ -96,6 +96,15 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Advanced Settings.
|
||||
/// </summary>
|
||||
public static string AdvancedSettings {
|
||||
get {
|
||||
return ResourceManager.GetString("AdvancedSettings", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Anime.
|
||||
/// </summary>
|
||||
@@ -213,6 +222,24 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether this media library should get the metadata of it elements by downloading it from the Internet, or not..
|
||||
/// </summary>
|
||||
public static string DescriptionDownloadMetadataFromWeb {
|
||||
get {
|
||||
return ResourceManager.GetString("DescriptionDownloadMetadataFromWeb", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether this media library is disabled or not. A disabled library is not displayed to the users, scanned, updated, etc..
|
||||
/// </summary>
|
||||
public static string DescriptionEnabled {
|
||||
get {
|
||||
return ResourceManager.GetString("DescriptionEnabled", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Select the type of media content this library will contain.
|
||||
/// </summary>
|
||||
@@ -222,6 +249,24 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether this media library is locked or not. A locked library is displayed to the users, but it is never scanned, updated, modified, etc..
|
||||
/// </summary>
|
||||
public static string DescriptionLocked {
|
||||
get {
|
||||
return ResourceManager.GetString("DescriptionLocked", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 {
|
||||
get {
|
||||
return ResourceManager.GetString("DescriptionSaveMetadataInMediaDirectories", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A name to identify this library.
|
||||
/// </summary>
|
||||
@@ -249,6 +294,15 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Download Metadata From The Web.
|
||||
/// </summary>
|
||||
public static string DownloadMetadataFromWeb {
|
||||
get {
|
||||
return ResourceManager.GetString("DownloadMetadataFromWeb", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to E Book.
|
||||
/// </summary>
|
||||
@@ -267,6 +321,15 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enabled.
|
||||
/// </summary>
|
||||
public static string Enabled {
|
||||
get {
|
||||
return ResourceManager.GetString("Enabled", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Film Franchise.
|
||||
/// </summary>
|
||||
@@ -339,6 +402,15 @@ namespace Lumina.Presentation.Web.Resources.Views.Library.Management {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Locked.
|
||||
/// </summary>
|
||||
public static string Locked {
|
||||
get {
|
||||
return ResourceManager.GetString("Locked", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Magazine.
|
||||
/// </summary>
|
||||
@@ -456,6 +528,15 @@ 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 {
|
||||
get {
|
||||
return ResourceManager.GetString("SaveMetadataInMediaDirectories", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Screenplay.
|
||||
/// </summary>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Neue Bibliothek Hinzufügen</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Erweiterte Einstellungen</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Wählen Sie die Ordner mit den Mediendateien dieser Bibliothek aus</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Ob diese Medienbibliothek die Metadaten ihrer Elemente aus dem Internet herunterladen soll oder nicht.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Ob diese Medienbibliothek deaktiviert ist oder nicht. Eine deaktivierte Bibliothek wird den Benutzern nicht angezeigt, nicht gescannt, nicht aktualisiert, usw.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Wählen Sie die Art der Medieninhalte aus, die diese Bibliothek enthalten soll</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>Eine Bezeichnung für diese Bibliothek</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Dokumentarfilm</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Metadaten Aus Dem Web Herunterladen</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>E-Buch</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Bibliothek Bearbeiten</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Aktiviert</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Filmfranchise</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Live-Auftritt</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Gesperrt</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Zeitschrift</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Speichern</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Metadaten In Medienverzeichnissen Speichern</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Drehbuch</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Add New Library</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Advanced Settings</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Select the folders containing the media files of this library</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Whether this media library should get the metadata of it elements by downloading it from the Internet, or not.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Whether this media library is disabled or not. A disabled library is not displayed to the users, scanned, updated, etc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Select the type of media content this library will contain</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>A name to identify this library</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documentary</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Download Metadata From The Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>E Book</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Edit Library</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Enabled</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Film Franchise</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Live Performance</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Locked</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Magazine</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Save</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Save Metadata In Media Directories</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Screenplay</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Agregar Nueva Biblioteca</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Configuración Avanzada</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Selecciona las carpetas que contienen los archivos multimedia de esta biblioteca</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Si esta biblioteca multimedia debe obtener los metadatos de sus elementos descargándolos de Internet o no.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Si esta biblioteca multimedia está desactivada o no. Una biblioteca desactivada no se muestra a los usuarios, no se escanea, no se actualiza, etc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Selecciona el tipo de contenido multimedia que contendrá esta biblioteca</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>Un nombre para identificar esta biblioteca</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documental</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Descargar Metadatos Desde La Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>Libro Electrónico</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Editar Biblioteca</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Activado</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Franquicia Cinematográfica</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Actuación en Vivo</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Bloqueado</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Revista</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Guardar</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Guardar Metadatos En Los Directorios Multimedia</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Guión</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Ajouter Une Nouvelle Bibliothèque</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Paramètres Avancés</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Animé</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Sélectionnez les dossiers contenant les fichiers multimédias de cette bibliothèque</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Si cette médiathèque doit obtenir les métadonnées de ses éléments en les téléchargeant depuis Internet ou non.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Si cette médiathèque est désactivée ou non. Une bibliothèque désactivée n'est pas affichée aux utilisateurs, ni analysée, ni mise à jour, etc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Choisissez le type de contenu multimédia que contiendra cette bibliothèque</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>Un nom pour identifier cette bibliothèque</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documentaire</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Télécharger Les Métadonnées Depuis Le Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>Livre Numérique</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Modifier La Bibliothèque</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Activé</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Franchise Cinématographique</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Concert Live</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Verrouillé</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Magazine</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Enregistrer</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Sauvegarder Les Métadonnées Dans Les Répertoires Média</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Scénario</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Aggiungi Nuova Libreria</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Impostazioni Avanzate</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Seleziona le cartelle che contengono i file multimediali di questa biblioteca</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Se questa libreria multimediale deve ottenere i metadati dei suoi elementi scaricandoli da Internet o meno.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Se questa libreria multimediale è disabilitata o meno. Una libreria disabilitata non viene mostrata agli utenti, scansionata, aggiornata, ecc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Seleziona il tipo di contenuti multimediali che questa biblioteca conterrà</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>Un nome per identificare questa biblioteca</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documentario</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Scarica I Metadati Dal Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>E-Book</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Modifica La Libreria</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Attivato</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Franchise Cinematografico</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Esibizione dal Vivo</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Bloccato</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Rivista</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Salva</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Salvare I Metadati Nelle Directory Multimediali</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Sceneggiatura</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>新しい ライブラリ 追加</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>詳細設定</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>アニメ</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>このライブラリのメディアファイルを含むフォルダを選択してください</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>このメディアライブラリの要素のメタデータをインターネットからダウンロードして取得するかどうか。</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>このメディアライブラリが無効になっているかどうか。無効化されたライブラリはユーザーに表示されず、スキャンされず、更新もされません。</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>この図書館に含める媒体コンテンツの種類を選択してください</value>
|
||||
</data>
|
||||
<data name="DescriptionLocked" xml:space="preserve">
|
||||
<value>このメディアライブラリがロックされているかどうか。ロックされたライブラリはユーザーに表示されますが、スキャン、更新、変更などは一切されません。</value>
|
||||
</data>
|
||||
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>ダウンロードしたメタデータのコピーをメディアライブラリのコンテンツディレクトリに保存するかどうか。これはウェブからのメタデータのダウンロードが有効な場合のみ効果があります。</value>
|
||||
</data>
|
||||
<data name="DescriptionTitle" xml:space="preserve">
|
||||
<value>この図書館を識別するための名称</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>ドキュメンタリー</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>ウェブからメタデータをダウンロード</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>電子書籍</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>ライブラリ 編集</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>有効</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>映画フランチャイズ</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>ライブパフォーマンス</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>ロック済</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>雑誌</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>保存</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>メディアディレクトリにメタデータを保存</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>脚本</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Add New Library</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Advanced Settings</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Select the folders containing the media files of this library</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Whether this media library should get the metadata of it elements by downloading it from the Internet, or not.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Whether this media library is disabled or not. A disabled library is not displayed to the users, scanned, updated, etc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Select the type of media content this library will contain</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>A name to identify this library</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documentary</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Download Metadata From The Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>E Book</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Edit Library</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Enabled</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Film Franchise</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Live Performance</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Locked</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Magazine</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Save</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Save Metadata In Media Directories</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Screenplay</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Adaugă Bibliotecă Nouă</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Setări Avansate</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Anime</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Selectează dosarele care conțin fișierele media ale acestei biblioteci</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Dacă această bibliotecă media ar trebui să obțină metadatele elementelor sale prin descărcare de pe Internet sau nu.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Dacă această bibliotecă media este dezactivată sau nu. O bibliotecă dezactivată nu este afișată utilizatorilor, scanată, actualizată, etc.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Selectează tipul de conținut media pe care îl va conține această bibliotecă</value>
|
||||
</data>
|
||||
<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">
|
||||
<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="DescriptionTitle" xml:space="preserve">
|
||||
<value>Un nume pentru identificarea acestei biblioteci</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Documentar</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Descarcă Metadate De Pe Web</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>Carte Electronică</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Editează Bibliotecă</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Activat</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Franciză de Film</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Spectacol Live</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Blocat</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Revistă</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Salvează</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Salvează Metadatele În Directoarele Media</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Scenariu</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>Добавить Новую Библиотеку</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>Расширенные Настройки</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>Аниме</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>Выберите папки, содержащие медиафайлы этой библиотеки</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Должна ли эта медиатека получать метаданные своих элементов путем загрузки из Интернета или нет.</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>Отключена эта медиатека или нет. Отключенная библиотека не отображается пользователям, не сканируется, не обновляется и т.д.</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>Выберите тип медиаконтента, который будет содержать эта библиотека</value>
|
||||
</data>
|
||||
<data name="DescriptionLocked" xml:space="preserve">
|
||||
<value>Заблокирована эта медиатека или нет. Заблокированная библиотека отображается пользователям, но никогда не сканируется, не обновляется, не изменяется и т.д.</value>
|
||||
</data>
|
||||
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Сохранять копию загруженных метаданных в каталогах содержимого медиатеки или нет. Это действует только если активна загрузка метаданных из интернета.</value>
|
||||
</data>
|
||||
<data name="DescriptionTitle" xml:space="preserve">
|
||||
<value>Название для этой библиотеки</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>Документальный Фильм</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>Загрузить Метаданные Из Интернета</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>Электронная Книга</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>Редактировать Библиотеку</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>Включено</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>Кинофраншиза</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>Живое Выступление</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>Заблокировано</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>Журнал</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Сохранить</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>Сохранить Метаданные В Каталогах Медиафайлов</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>Сценарий</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="AddNewLibrary" xml:space="preserve">
|
||||
<value>添加 新库</value>
|
||||
</data>
|
||||
<data name="AdvancedSettings" xml:space="preserve">
|
||||
<value>高级设置</value>
|
||||
</data>
|
||||
<data name="Anime" xml:space="preserve">
|
||||
<value>动画</value>
|
||||
</data>
|
||||
@@ -168,9 +171,21 @@
|
||||
<data name="DescriptionDirectories" xml:space="preserve">
|
||||
<value>选择包含该图书馆媒体文件的文件夹</value>
|
||||
</data>
|
||||
<data name="DescriptionDownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>此媒体库是否应该从互联网下载其元素的元数据。</value>
|
||||
</data>
|
||||
<data name="DescriptionEnabled" xml:space="preserve">
|
||||
<value>此媒体库是否已禁用。禁用的库不会显示给用户,不会被扫描、更新等。</value>
|
||||
</data>
|
||||
<data name="DescriptionLibraryType" xml:space="preserve">
|
||||
<value>选择这个图书馆将包含的媒体内容类型</value>
|
||||
</data>
|
||||
<data name="DescriptionLocked" xml:space="preserve">
|
||||
<value>此媒体库是否已锁定。锁定的库会显示给用户,但永远不会被扫描、更新、修改等。</value>
|
||||
</data>
|
||||
<data name="DescriptionSaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>是否在媒体库内容位置目录中保存已下载元数据的副本。这仅在从网络下载元数据处于活动状态时才有效。</value>
|
||||
</data>
|
||||
<data name="DescriptionTitle" xml:space="preserve">
|
||||
<value>给这个图书馆起个名字</value>
|
||||
</data>
|
||||
@@ -180,12 +195,18 @@
|
||||
<data name="Documentary" xml:space="preserve">
|
||||
<value>纪录片</value>
|
||||
</data>
|
||||
<data name="DownloadMetadataFromWeb" xml:space="preserve">
|
||||
<value>从网络下载元数据</value>
|
||||
</data>
|
||||
<data name="EBook" xml:space="preserve">
|
||||
<value>电子书</value>
|
||||
</data>
|
||||
<data name="EditLibrary" xml:space="preserve">
|
||||
<value>编辑 库</value>
|
||||
</data>
|
||||
<data name="Enabled" xml:space="preserve">
|
||||
<value>已启用</value>
|
||||
</data>
|
||||
<data name="FilmFranchise" xml:space="preserve">
|
||||
<value>电影系列品牌</value>
|
||||
</data>
|
||||
@@ -210,6 +231,9 @@
|
||||
<data name="LivePerformance" xml:space="preserve">
|
||||
<value>现场表演</value>
|
||||
</data>
|
||||
<data name="Locked" xml:space="preserve">
|
||||
<value>已锁定</value>
|
||||
</data>
|
||||
<data name="Magazine" xml:space="preserve">
|
||||
<value>杂志</value>
|
||||
</data>
|
||||
@@ -249,6 +273,9 @@
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>保存</value>
|
||||
</data>
|
||||
<data name="SaveMetadataInMediaDirectories" xml:space="preserve">
|
||||
<value>在媒体目录中保存元数据</value>
|
||||
</data>
|
||||
<data name="Screenplay" xml:space="preserve">
|
||||
<value>剧本</value>
|
||||
</data>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
const documentLoaded = async function () {
|
||||
// get the media libraries
|
||||
// TODO: add setting check whether the user desires this feature or not
|
||||
const data = await callApiGetAsync('@_urlService.GetAbsoluteUrl("GetLibraries", "LibraryManagement")');
|
||||
const data = await callApiGetAsync('@_urlService.GetAbsoluteUrl("GetEnabledLibraries", "LibraryManagement")');
|
||||
if (data && data.length > 0) {
|
||||
noLibrariesMessage.classList.replace('block', 'hidden');
|
||||
librariesContainer.classList.replace('justify-center', 'justify-start');
|
||||
|
||||
@@ -142,6 +142,56 @@
|
||||
</div>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionDirectories"]</small>
|
||||
</div>
|
||||
|
||||
<h3 class="text-light-two">@_localizer["AdvancedSettings"]</h3>
|
||||
<div class="form-row">
|
||||
<div class="form-label">
|
||||
<label asp-for="IsEnabled">@_localizer["Enabled"]</label>:
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" asp-for="IsEnabled" class="enlightenment-checkbox-hidden" />
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionEnabled"]</small>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label">
|
||||
<label asp-for="IsLocked">@_localizer["Locked"]</label>:
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" asp-for="IsLocked" class="enlightenment-checkbox-hidden" />
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionLocked"]</small>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label">
|
||||
<label asp-for="DownloadMedatadaFromWeb">@_localizer["DownloadMetadataFromWeb"]</label>:
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" asp-for="DownloadMedatadaFromWeb" class="enlightenment-checkbox-hidden"/>
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionDownloadMetadataFromWeb"]</small>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label">
|
||||
<label asp-for="SaveMetadataInMediaDirectories">@_localizer["SaveMetadataInMediaDirectories"]:</label>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" asp-for="SaveMetadataInMediaDirectories" class="enlightenment-checkbox-hidden" />
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionSaveMetadataInMediaDirectories"]</small>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button type="submit" class="confirm-button w-100px">@_localizer["Save"]</button>
|
||||
</div>
|
||||
@@ -168,6 +218,10 @@
|
||||
const imgAddCover = document.getElementById('add-media-cover');
|
||||
const mediaCoverFormTable = document.getElementById('add-media-cover-form-table');
|
||||
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"]');
|
||||
|
||||
// create new or update existing media library
|
||||
async function handleAddMediaLibraryAsync() {
|
||||
@@ -182,7 +236,11 @@
|
||||
// get the first (and only) span in the mediaCoverFormTable, if it exists
|
||||
const coverSpan = mediaCoverFormTable.querySelector('.form-table-row span');
|
||||
return coverSpan ? coverSpan.textContent : null; // return null if no cover image is selected
|
||||
})()
|
||||
})(),
|
||||
IsEnabled: chkIsEnabled.checked,
|
||||
IsLocked: chkIsLocked.checked,
|
||||
DownloadMedatadaFromWeb: chkDownloadMedatadaFromWeb.checked,
|
||||
SaveMetadataInMediaDirectories: chkSaveMetadataInMediaDirectories.checked
|
||||
};
|
||||
const data = await callApiPostAsync('@_urlService.GetAbsoluteUrl("SaveLibrary", "LibraryManagement")', formData);
|
||||
if (data) {
|
||||
|
||||
+28
-4
@@ -23,7 +23,11 @@ public class AddMediaLibraryRequestMappingTests
|
||||
"My Library",
|
||||
"Book",
|
||||
["C:/Books", "D:/Media/Books"],
|
||||
"D:/poster.jpg"
|
||||
"D:/poster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Act
|
||||
@@ -35,6 +39,10 @@ public class AddMediaLibraryRequestMappingTests
|
||||
result.LibraryType.Should().Be(request.LibraryType);
|
||||
result.ContentLocations.Should().BeEquivalentTo(request.ContentLocations);
|
||||
result.CoverImage.Should().BeEquivalentTo(request.CoverImage);
|
||||
result.IsEnabled.Should().Be(request.IsEnabled);
|
||||
result.IsLocked.Should().Be(request.IsLocked);
|
||||
result.DownloadMedatadaFromWeb.Should().Be(request.DownloadMedatadaFromWeb);
|
||||
result.SaveMetadataInMediaDirectories.Should().Be(request.SaveMetadataInMediaDirectories);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -49,7 +57,11 @@ public class AddMediaLibraryRequestMappingTests
|
||||
"My Library",
|
||||
libraryType.ToString(),
|
||||
["C:/Media"],
|
||||
"D:/poster.jpg"
|
||||
"D:/poster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Act
|
||||
@@ -61,6 +73,10 @@ public class AddMediaLibraryRequestMappingTests
|
||||
result.LibraryType.Should().Be(libraryType.ToString());
|
||||
result.ContentLocations.Should().BeEquivalentTo(request.ContentLocations);
|
||||
result.CoverImage.Should().BeEquivalentTo(request.CoverImage);
|
||||
result.IsEnabled.Should().Be(request.IsEnabled);
|
||||
result.IsLocked.Should().Be(request.IsLocked);
|
||||
result.DownloadMedatadaFromWeb.Should().Be(request.DownloadMedatadaFromWeb);
|
||||
result.SaveMetadataInMediaDirectories.Should().Be(request.SaveMetadataInMediaDirectories);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -79,7 +95,11 @@ public class AddMediaLibraryRequestMappingTests
|
||||
"My Library",
|
||||
"Book",
|
||||
contentLocations,
|
||||
"D:/poster.jpg"
|
||||
"D:/poster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Act
|
||||
@@ -104,7 +124,11 @@ public class AddMediaLibraryRequestMappingTests
|
||||
"My Library",
|
||||
"Book",
|
||||
contentLocations,
|
||||
null
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Act
|
||||
|
||||
+33
-5
@@ -30,7 +30,11 @@ public class LibraryMappingTests
|
||||
"Test Library",
|
||||
LibraryType.Book,
|
||||
["C:/Books", "D:/Media/Books"],
|
||||
"D:/myPoster.jpg"
|
||||
"D:/myPoster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
Library library = libraryResult.Value;
|
||||
|
||||
@@ -48,6 +52,10 @@ public class LibraryMappingTests
|
||||
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
|
||||
result.CreatedOnUtc.Should().Be(library.CreatedOnUtc);
|
||||
result.UpdatedOnUtc.Should().Be(library.UpdatedOnUtc.HasValue ? library.UpdatedOnUtc : null);
|
||||
result.IsEnabled.Should().BeTrue();
|
||||
result.IsLocked.Should().BeFalse();
|
||||
result.DownloadMedatadaFromWeb.Should().BeTrue();
|
||||
result.SaveMetadataInMediaDirectories.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -59,7 +67,11 @@ public class LibraryMappingTests
|
||||
"Empty Library",
|
||||
LibraryType.Book,
|
||||
[],
|
||||
"D:/myPoster.jpg"
|
||||
"D:/myPoster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
Library library = libraryResult.Value;
|
||||
|
||||
@@ -85,7 +97,11 @@ public class LibraryMappingTests
|
||||
"Test Library",
|
||||
libraryType,
|
||||
["C:/Media"],
|
||||
"D:/myPoster.jpg"
|
||||
"D:/myPoster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
Library library = libraryResult.Value;
|
||||
|
||||
@@ -96,6 +112,10 @@ public class LibraryMappingTests
|
||||
result.Should().NotBeNull();
|
||||
result.LibraryType.Should().Be(libraryType);
|
||||
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
|
||||
result.IsEnabled.Should().BeTrue();
|
||||
result.IsLocked.Should().BeFalse();
|
||||
result.DownloadMedatadaFromWeb.Should().BeTrue();
|
||||
result.SaveMetadataInMediaDirectories.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -115,7 +135,11 @@ public class LibraryMappingTests
|
||||
"Test Library",
|
||||
LibraryType.Book,
|
||||
contentLocations,
|
||||
"D:/myPoster.jpg"
|
||||
"D:/myPoster.jpg",
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
Library library = libraryResult.Value;
|
||||
|
||||
@@ -144,7 +168,11 @@ public class LibraryMappingTests
|
||||
"Test Library",
|
||||
LibraryType.Book,
|
||||
contentLocations,
|
||||
null
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
Library library = libraryResult.Value;
|
||||
|
||||
|
||||
+20
-4
@@ -48,7 +48,11 @@ public class DomainLibraryFixture
|
||||
_faker.Random.String2(_faker.Random.Number(1, 50)),
|
||||
_faker.PickRandom<LibraryType>(),
|
||||
validPaths.Take(_random.Next(1, validPaths.Count)),
|
||||
_faker.System.FilePath()
|
||||
_faker.System.FilePath(),
|
||||
_faker.Random.Bool(),
|
||||
_faker.Random.Bool(),
|
||||
_faker.Random.Bool(),
|
||||
_faker.Random.Bool()
|
||||
);
|
||||
|
||||
return library.Value;
|
||||
@@ -60,7 +64,11 @@ public class DomainLibraryFixture
|
||||
string? title = null,
|
||||
LibraryType? libraryType = null,
|
||||
IEnumerable<string>? contentLocations = null,
|
||||
string? coverImage = null)
|
||||
string? coverImage = null,
|
||||
bool isEnabled = true,
|
||||
bool isLocked = false,
|
||||
bool downloadMedatadaFromWeb = true,
|
||||
bool saveMetadataInMediaDirectories = false)
|
||||
{
|
||||
ErrorOr<Library> library = id is null ?
|
||||
Library.Create(
|
||||
@@ -68,7 +76,11 @@ public class DomainLibraryFixture
|
||||
title ?? _faker.Random.String2(_faker.Random.Number(1, 50)),
|
||||
libraryType ?? LibraryType.Book,
|
||||
contentLocations ?? ["C:/Media"],
|
||||
coverImage
|
||||
coverImage,
|
||||
isEnabled,
|
||||
isLocked,
|
||||
downloadMedatadaFromWeb,
|
||||
saveMetadataInMediaDirectories
|
||||
) :
|
||||
Library.Create(
|
||||
LibraryId.Create(id.Value),
|
||||
@@ -76,7 +88,11 @@ public class DomainLibraryFixture
|
||||
title ?? _faker.Random.String2(_faker.Random.Number(1, 50)),
|
||||
libraryType ?? LibraryType.Book,
|
||||
contentLocations ?? ["C:/Media"],
|
||||
coverImage
|
||||
coverImage,
|
||||
isEnabled,
|
||||
isLocked,
|
||||
downloadMedatadaFromWeb,
|
||||
saveMetadataInMediaDirectories
|
||||
);
|
||||
|
||||
return library.Value;
|
||||
|
||||
Reference in new issue
Block a user