mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds provider configuration to media library saves
Moves metadata provider, artwork provider, and book reader choices into the add and update library requests, adds the library type lookups, removes the per-provider enable and reorder endpoints, and reconciles the stored configurations in one provider store call. Tightens library update and delete authorization to require ownership and the manage permission, and cleans up enum validation, comments, resource diacritics, and Razor imports.
This commit is contained in:
1 parent
2e7563199a
commit
48ad8692af
148 files changed
+6305
-2936
No files matched your search
+2
@@ -1,5 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.DTO.Libraries;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
@@ -26,6 +27,7 @@ public class AddLibraryViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
Routes(WebRoutes.LibraryManagement.ADD_LIBRARY);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
Policies(AuthorizationPolicies.REQUIRE_CREATE_LIBRARIES_PERMISSION);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
@@ -39,6 +40,7 @@ public class DeleteLibraryEndpoint : BaseEndpoint<DeleteLibraryRequest, IResult>
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
Policies(AuthorizationPolicies.REQUIRE_CREATE_LIBRARIES_PERMISSION);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.DTO.Libraries;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
@@ -39,6 +40,7 @@ public class EditLibraryViewEndpoint : BaseEndpoint<EditLibraryRequest, IResult>
|
||||
Routes(WebRoutes.LibraryManagement.EDIT_LIBRARY);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
Policies(AuthorizationPolicies.REQUIRE_CREATE_LIBRARIES_PERMISSION);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.DTO.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeArtworkProviders;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-get-library-type-artwork-providers/{libraryType}</c> route.
|
||||
/// </summary>
|
||||
public class GetLibraryTypeArtworkProvidersEndpoint : BaseEndpoint<GetLibraryTypeArtworkProvidersRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeArtworkProvidersEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public GetLibraryTypeArtworkProvidersEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.GET);
|
||||
Routes(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_ARTWORK_PROVIDERS);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the artwork providers available for a media library type.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the media library type whose available artwork providers are retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetLibraryTypeArtworkProvidersRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
LibraryArtworkProviderDto[] response = await _apiHttpClient.GetAsync<LibraryArtworkProviderDto[]>(ApiRoutes.Libraries.GET_LIBRARY_TYPE_ARTWORK_PROVIDERS.Replace("{libraryType}", Uri.EscapeDataString(request.LibraryType)), cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeArtworkProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="GetLibraryTypeArtworkProvidersEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetLibraryTypeArtworkProvidersEndpointSummary : Summary<GetLibraryTypeArtworkProvidersEndpoint, GetLibraryTypeArtworkProvidersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeArtworkProvidersEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public GetLibraryTypeArtworkProvidersEndpointSummary()
|
||||
{
|
||||
Summary = "Retrieves the artwork providers available for a media library type.";
|
||||
Description = "Retrieves the artwork providers that support the media library type identified by the route, disabled and ranked in alphabetical order, the way a new media library of that type starts.";
|
||||
RequestParam(r => r.LibraryType, "The media library type whose available artwork providers are retrieved. Required.");
|
||||
|
||||
ExampleRequest = new GetLibraryTypeArtworkProvidersRequest(
|
||||
LibraryType: "Book"
|
||||
);
|
||||
|
||||
Response(200, "The artwork providers available for the media library type are returned.");
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.DTO.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeBookReaders;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-get-library-type-book-readers/{libraryType}</c> route.
|
||||
/// </summary>
|
||||
public class GetLibraryTypeBookReadersEndpoint : BaseEndpoint<GetLibraryTypeBookReadersRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeBookReadersEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public GetLibraryTypeBookReadersEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.GET);
|
||||
Routes(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_BOOK_READERS);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the book readers available for a media library type.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the media library type whose available book readers are retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetLibraryTypeBookReadersRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
LibraryBookReaderDto[] response = await _apiHttpClient.GetAsync<LibraryBookReaderDto[]>(ApiRoutes.Libraries.GET_LIBRARY_TYPE_BOOK_READERS.Replace("{libraryType}", Uri.EscapeDataString(request.LibraryType)), cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeBookReaders;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="GetLibraryTypeBookReadersEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetLibraryTypeBookReadersEndpointSummary : Summary<GetLibraryTypeBookReadersEndpoint, GetLibraryTypeBookReadersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeBookReadersEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public GetLibraryTypeBookReadersEndpointSummary()
|
||||
{
|
||||
Summary = "Retrieves the book readers available for a media library type.";
|
||||
Description = "Retrieves the book readers that support the media library type identified by the route, with their supported file extensions, disabled and in alphabetical order, the way a new media library of that type starts.";
|
||||
RequestParam(r => r.LibraryType, "The media library type whose available book readers are retrieved. Required.");
|
||||
|
||||
ExampleRequest = new GetLibraryTypeBookReadersRequest(
|
||||
LibraryType: "Book"
|
||||
);
|
||||
|
||||
Response(200, "The book readers available for the media library type are returned.");
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.DTO.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeMetadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-get-library-type-metadata-providers/{libraryType}</c> route.
|
||||
/// </summary>
|
||||
public class GetLibraryTypeMetadataProvidersEndpoint : BaseEndpoint<GetLibraryTypeMetadataProvidersRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeMetadataProvidersEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public GetLibraryTypeMetadataProvidersEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.GET);
|
||||
Routes(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_METADATA_PROVIDERS);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the metadata providers available for a media library type.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the media library type whose available metadata providers are retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetLibraryTypeMetadataProvidersRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
LibraryMetadataProviderDto[] response = await _apiHttpClient.GetAsync<LibraryMetadataProviderDto[]>(ApiRoutes.Libraries.GET_LIBRARY_TYPE_METADATA_PROVIDERS.Replace("{libraryType}", Uri.EscapeDataString(request.LibraryType)), cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Requests.Library.Management;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetLibraryTypeMetadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="GetLibraryTypeMetadataProvidersEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetLibraryTypeMetadataProvidersEndpointSummary : Summary<GetLibraryTypeMetadataProvidersEndpoint, GetLibraryTypeMetadataProvidersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetLibraryTypeMetadataProvidersEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public GetLibraryTypeMetadataProvidersEndpointSummary()
|
||||
{
|
||||
Summary = "Retrieves the metadata providers available for a media library type.";
|
||||
Description = "Retrieves the metadata providers that support the media library type identified by the route, disabled and ranked in alphabetical order, the way a new media library of that type starts.";
|
||||
RequestParam(r => r.LibraryType, "The media library type whose available metadata providers are retrieved. Required.");
|
||||
|
||||
ExampleRequest = new GetLibraryTypeMetadataProvidersRequest(
|
||||
LibraryType: "Book"
|
||||
);
|
||||
|
||||
Response(200, "The metadata providers available for the media library type are returned.");
|
||||
}
|
||||
}
|
||||
+20
-3
@@ -1,8 +1,10 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.DTO.Libraries;
|
||||
using Lumina.Presentation.Web.Common.Enums.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -15,6 +17,17 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.Index;
|
||||
/// </summary>
|
||||
public class LibrariesIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
{
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibrariesIndexViewEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="authorizationService">Injected service for authorization checks against the remote API.</param>
|
||||
public LibrariesIndexViewEndpoint(IAuthorizationService authorizationService)
|
||||
{
|
||||
_authorizationService = authorizationService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
@@ -32,8 +45,12 @@ public class LibrariesIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
/// </summary>
|
||||
/// <param name="request">The request object.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
|
||||
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(View("/Core/Views/Library/Management/Index.cshtml"));
|
||||
// Changing and deleting a media library takes the permission to manage media libraries, or the administrator role, the same rule the API applies,
|
||||
// so the actions are only offered to the users the API would let through.
|
||||
bool canManageLibraries = await _authorizationService.IsInRoleAsync("Admin", cancellationToken).ConfigureAwait(false) ||
|
||||
await _authorizationService.HasPermissionAsync(AuthorizationPermission.CanCreateLibraries, cancellationToken).ConfigureAwait(false);
|
||||
return View("/Core/Views/Library/Management/Index.cshtml", new LibrariesIndexPageDto(canManageLibraries));
|
||||
}
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.ReorderArtworkProviders;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-reorder-artwork-providers</c> route.
|
||||
/// </summary>
|
||||
public class ReorderArtworkProvidersEndpoint : BaseEndpoint<ReorderLibraryArtworkProvidersRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReorderArtworkProvidersEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public ReorderArtworkProvidersEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.PUT);
|
||||
Routes(WebRoutes.LibraryManagement.REORDER_ARTWORK_PROVIDERS);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reorders the artwork providers of a media library.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the Id of the media library and the plugin Ids in the new order.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(ReorderLibraryArtworkProvidersRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, ReorderLibraryArtworkProvidersRequest>(ApiRoutes.Libraries.REORDER_LIBRARY_ARTWORK_PROVIDERS.Replace("{libraryId}", request.LibraryId.ToString()), request, cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess();
|
||||
}
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.ReorderArtworkProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="ReorderArtworkProvidersEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderArtworkProvidersEndpointSummary : Summary<ReorderArtworkProvidersEndpoint, ReorderLibraryArtworkProvidersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReorderArtworkProvidersEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public ReorderArtworkProvidersEndpointSummary()
|
||||
{
|
||||
Summary = "Reorders the artwork providers of a media library.";
|
||||
Description = "Reorders the artwork providers of the media library identified by the route, in the provided order.";
|
||||
RequestParam(r => r.LibraryId, "The Id of the media library whose artwork providers are reordered. Required.");
|
||||
RequestParam(r => r.PluginIds, "The plugin Ids in the new order, from highest to lowest rank. Required.");
|
||||
|
||||
ExampleRequest = new ReorderLibraryArtworkProvidersRequest(
|
||||
LibraryId: Guid.NewGuid(),
|
||||
PluginIds: [Guid.NewGuid(), Guid.NewGuid()]
|
||||
);
|
||||
|
||||
Response(200, "The artwork providers of the media library are reordered.", example: new SuccessResponse(true));
|
||||
}
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.ReorderMetadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-reorder-metadata-providers</c> route.
|
||||
/// </summary>
|
||||
public class ReorderMetadataProvidersEndpoint : BaseEndpoint<ReorderLibraryMetadataProvidersRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReorderMetadataProvidersEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public ReorderMetadataProvidersEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.PUT);
|
||||
Routes(WebRoutes.LibraryManagement.REORDER_METADATA_PROVIDERS);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reorders the metadata providers of a media library.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the Id of the media library and the plugin Ids in the new order.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(ReorderLibraryMetadataProvidersRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, ReorderLibraryMetadataProvidersRequest>(ApiRoutes.Libraries.REORDER_LIBRARY_METADATA_PROVIDERS.Replace("{libraryId}", request.LibraryId.ToString()), request, cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess();
|
||||
}
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.ReorderMetadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="ReorderMetadataProvidersEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderMetadataProvidersEndpointSummary : Summary<ReorderMetadataProvidersEndpoint, ReorderLibraryMetadataProvidersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReorderMetadataProvidersEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public ReorderMetadataProvidersEndpointSummary()
|
||||
{
|
||||
Summary = "Reorders the metadata providers of a media library.";
|
||||
Description = "Reorders the metadata providers of the media library identified by the route.";
|
||||
RequestParam(r => r.LibraryId, "The Id of the media library whose metadata providers are reordered. Required.");
|
||||
RequestParam(r => r.PluginIds, "The plugin Ids in the new order, from highest to lowest rank. Required.");
|
||||
|
||||
ExampleRequest = new ReorderLibraryMetadataProvidersRequest(
|
||||
LibraryId: Guid.NewGuid(),
|
||||
PluginIds:
|
||||
[
|
||||
Guid.NewGuid(),
|
||||
Guid.NewGuid(),
|
||||
]
|
||||
);
|
||||
|
||||
Response(200, "The metadata providers of the media library are reordered.", example: new SuccessResponse(true));
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -21,7 +21,6 @@ public class SaveLibraryEndpointSummary : Summary<SaveLibraryEndpoint, LibraryDt
|
||||
Summary = "Creates or updates a media library.";
|
||||
Description = "Creates or updates the media library provided in the request.";
|
||||
RequestParam(r => r.Id, "The unique identifier of the media library. Optional, when creating a new media library.");
|
||||
RequestParam(r => r.UserId, "The unique identifier of the user owning the media library. Optional.");
|
||||
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.CoverImage, "The path of the image file used as the cover of the media library. Optional.");
|
||||
@@ -35,6 +34,9 @@ public class SaveLibraryEndpointSummary : Summary<SaveLibraryEndpoint, LibraryDt
|
||||
RequestParam(r => r.ShouldTrackConsumptionProgress, "Whether the consumption progress of the media library items should be tracked, or not. Optional, the default of the library type is used on create, and the stored value is kept on update.");
|
||||
RequestParam(r => r.CompletionThresholdPercentage, "The percentage of a media library item that must be consumed for its session to be considered completed. Optional, the default of the library type is used on create, and the stored value is kept on update.");
|
||||
RequestParam(r => r.PathTemplateParts, "The ordered parts of the template describing the structure of the media library on disk. Optional, the ideal structure of the library type is used when absent.");
|
||||
RequestParam(r => r.MetadataProviders, "The metadata providers of the media library, in the order in which they are tried, and whether each one is enabled. Optional, the providers are configured with their defaults on create, and the stored configurations are kept on update, when absent.");
|
||||
RequestParam(r => r.ArtworkProviders, "The artwork providers of the media library, in the order in which they are tried, and whether each one is enabled. Optional, the providers are configured with their defaults on create, and the stored configurations are kept on update, when absent.");
|
||||
RequestParam(r => r.BookReaders, "The book readers of the media library, and whether each one is enabled. Optional, the readers are configured with their defaults on create, and the stored configurations are kept on update, when absent.");
|
||||
|
||||
ExampleRequest = new LibraryDto();
|
||||
|
||||
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetArtworkProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-set-artwork-provider-enabled</c> route.
|
||||
/// </summary>
|
||||
public class SetArtworkProviderEnabledEndpoint : BaseEndpoint<SetLibraryArtworkProviderEnabledRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetArtworkProviderEnabledEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public SetArtworkProviderEnabledEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.PUT);
|
||||
Routes(WebRoutes.LibraryManagement.SET_ARTWORK_PROVIDER_ENABLED);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables an artwork provider of a media library.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the Ids of the media library and of the plugin, and whether the provider is enabled.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(SetLibraryArtworkProviderEnabledRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, SetLibraryArtworkProviderEnabledRequest>(ApiRoutes.Libraries.SET_LIBRARY_ARTWORK_PROVIDER_ENABLED.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{pluginId}", request.PluginId.ToString()), request, cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess();
|
||||
}
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetArtworkProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="SetArtworkProviderEnabledEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetArtworkProviderEnabledEndpointSummary : Summary<SetArtworkProviderEnabledEndpoint, SetLibraryArtworkProviderEnabledRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetArtworkProviderEnabledEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public SetArtworkProviderEnabledEndpointSummary()
|
||||
{
|
||||
Summary = "Enables or disables an artwork provider of a media library.";
|
||||
Description = "Enables or disables the artwork provider of the media library identified by the route.";
|
||||
RequestParam(r => r.LibraryId, "The Id of the media library whose artwork provider is enabled or disabled. Required.");
|
||||
RequestParam(r => r.PluginId, "The unique identifier of the plugin providing the artwork. Required.");
|
||||
RequestParam(r => r.IsEnabled, "Whether the artwork provider should be enabled for the media library, or not. Required.");
|
||||
|
||||
ExampleRequest = new SetLibraryArtworkProviderEnabledRequest(
|
||||
LibraryId: Guid.NewGuid(),
|
||||
PluginId: Guid.NewGuid(),
|
||||
IsEnabled: true
|
||||
);
|
||||
|
||||
Response(200, "The artwork provider of the media library is enabled or disabled.", example: new SuccessResponse(true));
|
||||
}
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetBookReaderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-set-book-reader-enabled</c> route.
|
||||
/// </summary>
|
||||
public class SetBookReaderEnabledEndpoint : BaseEndpoint<SetBookReaderEnabledRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetBookReaderEnabledEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public SetBookReaderEnabledEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.PUT);
|
||||
Routes(WebRoutes.LibraryManagement.SET_BOOK_READER_ENABLED);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables a book reader of a media library.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the Ids of the media library and of the plugin, and whether the book reader is enabled.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(SetBookReaderEnabledRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, SetBookReaderEnabledRequest>(ApiRoutes.Libraries.SET_LIBRARY_BOOK_READER_ENABLED.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{pluginId}", request.PluginId.ToString()), request, cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess();
|
||||
}
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetBookReaderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="SetBookReaderEnabledEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetBookReaderEnabledEndpointSummary : Summary<SetBookReaderEnabledEndpoint, SetBookReaderEnabledRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetBookReaderEnabledEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public SetBookReaderEnabledEndpointSummary()
|
||||
{
|
||||
Summary = "Enables or disables a book reader of a media library.";
|
||||
Description = "Enables or disables the book reader of the media library identified by the route.";
|
||||
RequestParam(r => r.LibraryId, "The Id of the media library whose book reader is enabled or disabled. Required.");
|
||||
RequestParam(r => r.PluginId, "The unique identifier of the plugin providing the book reader. Required.");
|
||||
RequestParam(r => r.IsEnabled, "Whether the book reader should be enabled for the media library, or not. Required.");
|
||||
|
||||
ExampleRequest = new SetBookReaderEnabledRequest(
|
||||
LibraryId: Guid.NewGuid(),
|
||||
PluginId: Guid.NewGuid(),
|
||||
IsEnabled: true
|
||||
);
|
||||
|
||||
Response(200, "The book reader of the media library is enabled or disabled.", example: new SuccessResponse(true));
|
||||
}
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using Lumina.Presentation.Web.Common.Routes;
|
||||
using Lumina.Presentation.Web.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetMetadataProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/{culture}/libraries/manage/api-set-metadata-provider-enabled</c> route.
|
||||
/// </summary>
|
||||
public class SetMetadataProviderEnabledEndpoint : BaseEndpoint<SetLibraryMetadataProviderEnabledRequest, IResult>
|
||||
{
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetMetadataProviderEnabledEndpoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
||||
public SetMetadataProviderEnabledEndpoint(IApiHttpClient apiHttpClient)
|
||||
{
|
||||
_apiHttpClient = apiHttpClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the endpoint.
|
||||
/// </summary>
|
||||
public override void Configure()
|
||||
{
|
||||
base.Configure();
|
||||
Verbs(Http.PUT);
|
||||
Routes(WebRoutes.LibraryManagement.SET_METADATA_PROVIDER_ENABLED);
|
||||
DontAutoTag();
|
||||
Options(options => options.WithTags("Libraries"));
|
||||
EnableAntiforgery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables a metadata provider of a media library.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the Ids of the media library and of the plugin, and whether the provider is enabled.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(SetLibraryMetadataProviderEnabledRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, SetLibraryMetadataProviderEnabledRequest>(ApiRoutes.Libraries.SET_LIBRARY_METADATA_PROVIDER_ENABLED.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{pluginId}", request.PluginId.ToString()), request, cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess();
|
||||
}
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using Lumina.Presentation.Web.Common.Requests.Plugins;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.SetMetadataProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Class used for providing a textual description for the <see cref="SetMetadataProviderEnabledEndpoint"/> endpoint, for OpenAPI.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetMetadataProviderEnabledEndpointSummary : Summary<SetMetadataProviderEnabledEndpoint, SetLibraryMetadataProviderEnabledRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetMetadataProviderEnabledEndpointSummary"/> class.
|
||||
/// </summary>
|
||||
public SetMetadataProviderEnabledEndpointSummary()
|
||||
{
|
||||
Summary = "Enables or disables a metadata provider of a media library.";
|
||||
Description = "Enables or disables the metadata provider of the media library identified by the route.";
|
||||
RequestParam(r => r.LibraryId, "The Id of the media library whose metadata provider is enabled or disabled. Required.");
|
||||
RequestParam(r => r.PluginId, "The unique identifier of the plugin providing the metadata. Required.");
|
||||
RequestParam(r => r.IsEnabled, "Whether the metadata provider should be enabled for the media library, or not. Required.");
|
||||
|
||||
ExampleRequest = new SetLibraryMetadataProviderEnabledRequest(
|
||||
LibraryId: Guid.NewGuid(),
|
||||
PluginId: Guid.NewGuid(),
|
||||
IsEnabled: true
|
||||
);
|
||||
|
||||
Response(200, "The metadata provider of the media library is enabled or disabled.", example: new SuccessResponse(true));
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>لا يمكن أن يكون معرف الإضافة فارغًا!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>لا يمكن أن تكون قائمة معرفات الإضافات فارغة!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>لا يمكن اختيار الإضافة نفسها أكثر من مرة!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>لا يمكن أن تكون قائمة معرفات الإضافات فارغة!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>الإضافة لا تدعم نوع مكتبة الوسائط!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>لم يتم العثور على الإضافة!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>Die Plugin-ID darf nicht leer sein!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>Die Plugin-ID-Liste darf nicht leer sein!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>Dasselbe Plugin darf nicht mehrfach ausgewählt werden!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>Die Plugin-ID-Liste darf nicht null sein!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>Das Plugin unterstützt den Medienbibliothekstyp nicht!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>Das Plugin wurde nicht gefunden!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>The plugin Id cannot be empty!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>The plugin Ids list cannot be empty!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>The same plugin cannot be chosen more than once!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>The plugin Ids list cannot be null!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>The plugin does not support the media library type!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>The plugin was not found!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>¡El Id del plugin no puede estar vacío!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>¡La lista de Ids de plugins no puede estar vacía!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>¡No se puede elegir el mismo plugin más de una vez!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>¡La lista de Ids de plugins no puede ser nula!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>¡El plugin no admite el tipo de biblioteca multimedia!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>¡El plugin no fue encontrado!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>L'Id du plugin ne peut pas être vide !</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>La liste des Ids de plugins ne peut pas être vide !</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>Le même plugin ne peut pas être choisi plus d'une fois !</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>La liste des Ids de plugins ne peut pas être nulle !</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>Le plugin ne prend pas en charge le type de médiathèque !</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>Le plugin est introuvable !</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>L'Id del plugin non può essere vuoto!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>L'elenco degli Id dei plugin non può essere vuoto!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>Lo stesso plugin non può essere scelto più di una volta!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>L'elenco degli Id dei plugin non può essere nullo!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>Il plugin non supporta il tipo di libreria multimediale!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>Il plugin non è stato trovato!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>プラグイン ID を空にすることはできません。</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>プラグイン ID のリストを空にすることはできません。</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>同じプラグインを複数回選択することはできません。</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>プラグイン ID のリストを null にすることはできません。</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>このプラグインはメディアライブラリの種類に対応していません。</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>プラグインが見つかりませんでした。</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>The plugin Id cannot be empty!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>The plugin Ids list cannot be empty!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>The same plugin cannot be chosen more than once!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>The plugin Ids list cannot be null!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>The plugin does not support the media library type!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>The plugin was not found!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>Id-ul pluginului nu poate fi gol!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>Lista Id-urilor de pluginuri nu poate fi goala!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>Același plugin nu poate fi ales de mai multe ori!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>Lista Id-urilor de pluginuri nu poate fi nula!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>Pluginul nu suportă tipul bibliotecii media!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>Pluginul nu a fost gasit!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>Ідентифікатор плагіна не може бути порожнім!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>Список ідентифікаторів плагінів не може бути порожнім!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>Той самий плагін не можна вибрати більше одного разу!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>Список ідентифікаторів плагінів не може бути порожнім!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>Плагін не підтримує тип медіатеки!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>Плагін не знайдено!</value>
|
||||
|
||||
+4
-4
@@ -540,11 +540,11 @@
|
||||
<data name="PluginIdCannotBeEmpty" xml:space="preserve">
|
||||
<value>插件 Id 不能为空!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeEmpty" xml:space="preserve">
|
||||
<value>插件 Id 列表不能为空!</value>
|
||||
<data name="PluginIdsMustBeUnique" xml:space="preserve">
|
||||
<value>同一插件不能被多次选择!</value>
|
||||
</data>
|
||||
<data name="PluginIdsListCannotBeNull" xml:space="preserve">
|
||||
<value>插件 Id 列表不能为 null!</value>
|
||||
<data name="PluginNotSupportedForLibraryType" xml:space="preserve">
|
||||
<value>该插件不支持此媒体库类型!</value>
|
||||
</data>
|
||||
<data name="PluginNotFound" xml:space="preserve">
|
||||
<value>未找到插件!</value>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>نقل لأسفل</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>تم حفظ الترتيب</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>مزوّدو البيانات الوصفية المستخدمون لإثراء عناصر هذه المكتبة، بالترتيب الذي يتم تجريبهم به.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Nach unten</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Reihenfolge gespeichert</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>Die Metadatenanbieter, die verwendet werden, um die Elemente dieser Bibliothek anzureichern, in der Reihenfolge, in der sie versucht werden.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Move down</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Order saved</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>The metadata providers used to enrich the items of this library, in the order they are tried.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Bajar</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Orden guardado</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>Los proveedores de metadatos utilizados para enriquecer los elementos de esta biblioteca, en el orden en que se prueban.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Descendre</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Ordre enregistré</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>Les fournisseurs de métadonnées utilisés pour enrichir les éléments de cette bibliothèque, dans l'ordre où ils sont essayés.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Sposta giù</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Ordine salvato</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>I fornitori di metadati utilizzati per arricchire gli elementi di questa libreria, nell'ordine in cui vengono provati.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>下へ移動</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>順序を保存しました</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>このライブラリのアイテムを補完するために使用されるメタデータプロバイダーを、試行する順序で指定します。</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Move down</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Order saved</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>The metadata providers used to enrich the items of this library, in the order they are tried.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Mută în jos</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Ordine salvată</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>Furnizorii de metadate folosiți pentru a îmbogăți elementele acestei biblioteci, în ordinea în care sunt încercați.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>Вниз</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>Порядок збережено</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>Постачальники метаданих, які використовуються для збагачення елементів цієї бібліотеки, у порядку, в якому вони випробовуються.</value>
|
||||
</data>
|
||||
|
||||
@@ -333,9 +333,6 @@
|
||||
<data name="MoveDown" xml:space="preserve">
|
||||
<value>下移</value>
|
||||
</data>
|
||||
<data name="OrderSaved" xml:space="preserve">
|
||||
<value>顺序已保存</value>
|
||||
</data>
|
||||
<data name="DescriptionMetadataProviders" xml:space="preserve">
|
||||
<value>用于丰富此库项目内容的元数据提供程序,按其尝试顺序排列。</value>
|
||||
</data>
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
@using Lumina.Presentation.Web.Common.DTO.Libraries
|
||||
@using Lumina.Presentation.Web.Common.Services
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@using System.Collections.Generic
|
||||
@using System.Security.Claims
|
||||
@using System.Text.Json
|
||||
@model LibrariesIndexPageDto
|
||||
|
||||
@{
|
||||
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
|
||||
@@ -165,58 +168,89 @@
|
||||
// Create cleanup registry for this view.
|
||||
const cleanupFunctions = [];
|
||||
let isInitialized = false;
|
||||
const jsLocalizedLibraryScanStatuses = {
|
||||
Completed: '@_localizer["Completed"]',
|
||||
Failed: '@_localizer["Failed"]',
|
||||
Canceled: '@_localizer["Canceled"]',
|
||||
Cancelling: '@_localizer["Cancelling"]'
|
||||
};
|
||||
const jsLocalizedLibraryScanJobsStatuses = {
|
||||
DiscoveringFiles: '@_localizer["DiscoveringFiles"]',
|
||||
ComparingFileHashes: '@_localizer["ComparingFileHashes"]',
|
||||
HashingFileContents: '@_localizer["HashingFileContents"]',
|
||||
ExtractingMetadata: '@_localizer["ExtractingMetadata"]',
|
||||
SavingScanData: '@_localizer["SavingScanData"]',
|
||||
InvalidatingStaleEnrichment: '@_localizer["InvalidatingStaleEnrichment"]',
|
||||
EnrichingMetadata: '@_localizer["EnrichingMetadata"]',
|
||||
ResolvingArtwork: '@_localizer["ResolvingArtwork"]',
|
||||
Queued: '@_localizer["Queued"]'
|
||||
};
|
||||
const jsLocalizedLibraryTypes = {
|
||||
Book: '@_localizer["Book"]',
|
||||
EBook: '@_localizer["EBook"]',
|
||||
BookSeries: '@_localizer["BookSeries"]',
|
||||
ComicBook: '@_localizer["ComicBook"]',
|
||||
ComicSeries: '@_localizer["ComicSeries"]',
|
||||
Magazine: '@_localizer["Magazine"]',
|
||||
Manga: '@_localizer["Manga"]',
|
||||
GraphicNovel: '@_localizer["GraphicNovel"]',
|
||||
AcademicPaper: '@_localizer["AcademicPaper"]',
|
||||
SheetMusic: '@_localizer["SheetMusic"]',
|
||||
Screenplay: '@_localizer["Screenplay"]',
|
||||
TvShow: '@_localizer["TvShow"]',
|
||||
Movie: '@_localizer["Movie"]',
|
||||
FilmSeries: '@_localizer["FilmSeries"]',
|
||||
FilmFranchise: '@_localizer["FilmFranchise"]',
|
||||
Concert: '@_localizer["Concert"]',
|
||||
Documentary: '@_localizer["Documentary"]',
|
||||
Tutorial: '@_localizer["Tutorial"]',
|
||||
Personal: '@_localizer["Personal"]',
|
||||
Anime: '@_localizer["Anime"]',
|
||||
Youtube: '@_localizer["Youtube"]',
|
||||
Videoclip: '@_localizer["Videoclip"]',
|
||||
Music: '@_localizer["Music"]',
|
||||
AudioBook: '@_localizer["AudioBook"]',
|
||||
LivePerformance: '@_localizer["LivePerformance"]',
|
||||
Interview: '@_localizer["Interview"]',
|
||||
Cover: '@_localizer["Cover"]',
|
||||
Remix: '@_localizer["Remix"]',
|
||||
Soundeffect: '@_localizer["Soundeffect"]',
|
||||
Podcast: '@_localizer["Podcast"]',
|
||||
RadioShow: '@_localizer["RadioShow"]',
|
||||
PhotoAlbum: '@_localizer["PhotoAlbum"]',
|
||||
Other: '@_localizer["Other"]'
|
||||
};
|
||||
// Changing and deleting a media library takes the permission to manage media libraries, or the administrator role, so the edit and delete actions are
|
||||
// only rendered for the users the server would let through.
|
||||
const canManageLibraries = @(Model.CanManageLibraries ? "true" : "false");
|
||||
// The localized strings used inside this script are injected as JSON, not as raw HTML text: Razor HTML-encodes non-ASCII characters into numeric
|
||||
// entities, which the browser does not decode inside a script element, and a translation containing a quote, a backtick or "${" would break out of
|
||||
// the string or template literal it was placed in. JSON escapes them, so the script reads them correctly.
|
||||
const jsLocalizedLibraryScanStatuses = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["Completed"] = _localizer["Completed"].Value,
|
||||
["Failed"] = _localizer["Failed"].Value,
|
||||
["Canceled"] = _localizer["Canceled"].Value,
|
||||
["Cancelling"] = _localizer["Cancelling"].Value
|
||||
}));
|
||||
const jsLocalizedLibraryScanJobsStatuses = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["DiscoveringFiles"] = _localizer["DiscoveringFiles"].Value,
|
||||
["ComparingFileHashes"] = _localizer["ComparingFileHashes"].Value,
|
||||
["HashingFileContents"] = _localizer["HashingFileContents"].Value,
|
||||
["ExtractingMetadata"] = _localizer["ExtractingMetadata"].Value,
|
||||
["SavingScanData"] = _localizer["SavingScanData"].Value,
|
||||
["InvalidatingStaleEnrichment"] = _localizer["InvalidatingStaleEnrichment"].Value,
|
||||
["EnrichingMetadata"] = _localizer["EnrichingMetadata"].Value,
|
||||
["ResolvingArtwork"] = _localizer["ResolvingArtwork"].Value,
|
||||
["Queued"] = _localizer["Queued"].Value
|
||||
}));
|
||||
const jsLocalizedLibraryTypes = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["Book"] = _localizer["Book"].Value,
|
||||
["EBook"] = _localizer["EBook"].Value,
|
||||
["BookSeries"] = _localizer["BookSeries"].Value,
|
||||
["ComicBook"] = _localizer["ComicBook"].Value,
|
||||
["ComicSeries"] = _localizer["ComicSeries"].Value,
|
||||
["Magazine"] = _localizer["Magazine"].Value,
|
||||
["Manga"] = _localizer["Manga"].Value,
|
||||
["GraphicNovel"] = _localizer["GraphicNovel"].Value,
|
||||
["AcademicPaper"] = _localizer["AcademicPaper"].Value,
|
||||
["SheetMusic"] = _localizer["SheetMusic"].Value,
|
||||
["Screenplay"] = _localizer["Screenplay"].Value,
|
||||
["TvShow"] = _localizer["TvShow"].Value,
|
||||
["Movie"] = _localizer["Movie"].Value,
|
||||
["FilmSeries"] = _localizer["FilmSeries"].Value,
|
||||
["FilmFranchise"] = _localizer["FilmFranchise"].Value,
|
||||
["Concert"] = _localizer["Concert"].Value,
|
||||
["Documentary"] = _localizer["Documentary"].Value,
|
||||
["Tutorial"] = _localizer["Tutorial"].Value,
|
||||
["Personal"] = _localizer["Personal"].Value,
|
||||
["Anime"] = _localizer["Anime"].Value,
|
||||
["Youtube"] = _localizer["Youtube"].Value,
|
||||
["Videoclip"] = _localizer["Videoclip"].Value,
|
||||
["Music"] = _localizer["Music"].Value,
|
||||
["AudioBook"] = _localizer["AudioBook"].Value,
|
||||
["LivePerformance"] = _localizer["LivePerformance"].Value,
|
||||
["Interview"] = _localizer["Interview"].Value,
|
||||
["Cover"] = _localizer["Cover"].Value,
|
||||
["Remix"] = _localizer["Remix"].Value,
|
||||
["Soundeffect"] = _localizer["Soundeffect"].Value,
|
||||
["Podcast"] = _localizer["Podcast"].Value,
|
||||
["RadioShow"] = _localizer["RadioShow"].Value,
|
||||
["PhotoAlbum"] = _localizer["PhotoAlbum"].Value,
|
||||
["Other"] = _localizer["Other"].Value
|
||||
}));
|
||||
const jsLocalizedLabels = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["Yes"] = _localizer["Yes"].Value,
|
||||
["No"] = _localizer["No"].Value,
|
||||
["Completed"] = _localizer["Completed"].Value,
|
||||
["Failed"] = _localizer["Failed"].Value,
|
||||
["Canceled"] = _localizer["Canceled"].Value,
|
||||
["CancelScan"] = _localizer["CancelScan"].Value,
|
||||
["Scan"] = _localizer["Scan"].Value,
|
||||
["Edit"] = _localizer["Edit"].Value,
|
||||
["Remove"] = _localizer["Remove"].Value,
|
||||
["DeleteLibraryConfirm"] = _localizer["DeleteLibraryConfirm"].Value,
|
||||
["LibraryDeleted"] = _localizer["LibraryDeleted"].Value
|
||||
}));
|
||||
|
||||
// Escapes a value for use as text or as a quoted attribute value inside markup, since the titles of the libraries are typed by their users.
|
||||
function escapeHtml(value) {
|
||||
const div = document.createElement('div');
|
||||
div.textContent = value ?? '';
|
||||
return div.innerHTML.replace(/"/g, '"');
|
||||
}
|
||||
|
||||
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
|
||||
const btnScanAllLibraries = document.getElementById('btn-scan-all-libraries');
|
||||
const btnCancelLibrariesScan = document.getElementById('btn-cancel-libraries-scan');
|
||||
@@ -250,13 +284,13 @@
|
||||
btnScanAllLibraries.style.display = 'block';
|
||||
tbody.innerHTML = response.map(library => {
|
||||
const editUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.EDIT_LIBRARY, new { id = default(Guid) })'
|
||||
.replace('/@(default(Guid))', `/${library.id}`);
|
||||
.replace('/@(default(Guid))', `/${encodeURIComponent(library.id)}`);
|
||||
return `
|
||||
<tr data-library-id="${library.id}">
|
||||
<td title="${library.title}">${library.title}</td>
|
||||
<td>${jsLocalizedLibraryTypes[library.libraryType]}</td>
|
||||
<td class="text-center">${library.isEnabled === true ? `@_localizer["Yes"]` : `@_localizer["No"]`}</td>
|
||||
<td class="text-center">${library.isLocked === true ? `@_localizer["Yes"]` : `@_localizer["No"]`}</td>
|
||||
<tr data-library-id="${escapeHtml(library.id)}">
|
||||
<td title="${escapeHtml(library.title)}">${escapeHtml(library.title)}</td>
|
||||
<td>${escapeHtml(jsLocalizedLibraryTypes[library.libraryType] ?? library.libraryType)}</td>
|
||||
<td class="text-center">${escapeHtml(library.isEnabled === true ? jsLocalizedLabels.Yes : jsLocalizedLabels.No)}</td>
|
||||
<td class="text-center">${escapeHtml(library.isLocked === true ? jsLocalizedLabels.Yes : jsLocalizedLabels.No)}</td>
|
||||
<td class="td-scan">
|
||||
<span class="scan-job-status hidden">Downloading metadata</span>
|
||||
<div class="scan-progress hidden">
|
||||
@@ -266,18 +300,19 @@
|
||||
|
||||
<div class="icon-groups">
|
||||
<div class="status-icons">
|
||||
<img src="/images/ui/green.png" alt="@_localizer["Completed"]" title="@_localizer["Completed"]" class="hidden status-icon" />
|
||||
<img src="/images/ui/red.png" alt="@_localizer["Failed"]" title="@_localizer["Failed"]" class="hidden status-icon" />
|
||||
<img src="/images/ui/yellow.png" alt="@_localizer["Canceled"]" title="@_localizer["Canceled"]" class="hidden status-icon" />
|
||||
<img src="/images/ui/green.png" alt="${escapeHtml(jsLocalizedLabels.Completed)}" title="${escapeHtml(jsLocalizedLabels.Completed)}" class="hidden status-icon" />
|
||||
<img src="/images/ui/red.png" alt="${escapeHtml(jsLocalizedLabels.Failed)}" title="${escapeHtml(jsLocalizedLabels.Failed)}" class="hidden status-icon" />
|
||||
<img src="/images/ui/yellow.png" alt="${escapeHtml(jsLocalizedLabels.Canceled)}" title="${escapeHtml(jsLocalizedLabels.Canceled)}" class="hidden status-icon" />
|
||||
</div>
|
||||
|
||||
<div class="action-icons">
|
||||
<img src="/images/ui/stop.svg" alt="@_localizer["CancelScan"]" title="@_localizer["CancelScan"]" class="hidden action-icon" />
|
||||
<img src="/images/ui/trigger.svg" alt="@_localizer["Scan"]" title="@_localizer["Scan"]" class="action-icon" />
|
||||
<a href="${editUrl}" class="nav-link">
|
||||
<img src="/images/ui/edit.svg" alt="@_localizer["Edit"]" title="@_localizer["Edit"]" class="action-icon" />
|
||||
<img src="/images/ui/stop.svg" alt="${escapeHtml(jsLocalizedLabels.CancelScan)}" title="${escapeHtml(jsLocalizedLabels.CancelScan)}" class="hidden action-icon" />
|
||||
<img src="/images/ui/trigger.svg" alt="${escapeHtml(jsLocalizedLabels.Scan)}" title="${escapeHtml(jsLocalizedLabels.Scan)}" class="action-icon" />
|
||||
${canManageLibraries ? `
|
||||
<a href="${escapeHtml(editUrl)}" class="nav-link">
|
||||
<img src="/images/ui/edit.svg" alt="${escapeHtml(jsLocalizedLabels.Edit)}" title="${escapeHtml(jsLocalizedLabels.Edit)}" class="action-icon" />
|
||||
</a>
|
||||
<img src="/images/ui/delete.svg" alt="@_localizer["Remove"]" title="@_localizer["Remove"]" class="mr-5 action-icon" />
|
||||
<img src="/images/ui/delete.svg" alt="${escapeHtml(jsLocalizedLabels.Remove)}" title="${escapeHtml(jsLocalizedLabels.Remove)}" class="mr-5 action-icon" />` : ''}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -297,7 +332,7 @@
|
||||
const response = await callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_RUNNING_LIBRARY_SCANS)');
|
||||
if (response && response.length > 0) {
|
||||
await Promise.all(response.map(async scan => {
|
||||
const row = document.querySelector(`tr[data-library-id="${scan.libraryId}"]`);
|
||||
const row = document.querySelector(`tr[data-library-id="${CSS.escape(String(scan.libraryId))}"]`);
|
||||
if (row) {
|
||||
// Restore UI state.
|
||||
const scanProgress = row.querySelector('.scan-progress');
|
||||
@@ -336,14 +371,14 @@
|
||||
if (e.target.matches('img[src*="delete.svg"]')) {
|
||||
const row = e.target.closest('tr');
|
||||
|
||||
if (await dialogService.show('@_localizer["DeleteLibraryConfirm"]', jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
|
||||
if (await dialogService.show(jsLocalizedLabels.DeleteLibraryConfirm, jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
|
||||
const libraryId = row.getAttribute('data-library-id');
|
||||
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.DELETE_LIBRARY, new { id = default(Guid) })';
|
||||
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${libraryId}`));
|
||||
|
||||
if (success) {
|
||||
await loadLibrariesAsync(); // Reload the entire library list.
|
||||
notificationService.show('@_localizer["LibraryDeleted"]', NotificationType.SUCCESS);
|
||||
notificationService.show(jsLocalizedLabels.LibraryDeleted, NotificationType.SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,7 +394,7 @@
|
||||
// Toggle icons only for libraries that had their scan started.
|
||||
const tbody = document.querySelector('tbody');
|
||||
data.forEach(async scan => {
|
||||
const row = tbody.querySelector(`tr[data-library-id="${scan.libraryId}"]`);
|
||||
const row = tbody.querySelector(`tr[data-library-id="${CSS.escape(String(scan.libraryId))}"]`);
|
||||
if (row) {
|
||||
row.setAttribute('data-scan-id', scan.scanId);
|
||||
const scanIcon = row.querySelector('img[src*="trigger.svg"]');
|
||||
@@ -499,7 +534,7 @@
|
||||
};
|
||||
// Progress update handler.
|
||||
const progressHandler = (progress) => {
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${progress.scanId}"]`);
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${CSS.escape(String(progress.scanId))}"]`);
|
||||
rows.forEach(row => {
|
||||
// Update status text.
|
||||
const currentOperation = progress.currentJobProgress.currentOperation;
|
||||
@@ -528,7 +563,7 @@
|
||||
|
||||
// Scan completion handler.
|
||||
const completionHandler = (progress) => {
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${progress.scanId}"]`);
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${CSS.escape(String(progress.scanId))}"]`);
|
||||
rows.forEach(row => {
|
||||
// Remove the scan Id, its no longer being scanned.
|
||||
row.removeAttribute('data-scan-id');
|
||||
@@ -555,7 +590,7 @@
|
||||
|
||||
// Scan failure handler.
|
||||
const failureHandler = (progress) => {
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${progress.scanId}"]`);
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${CSS.escape(String(progress.scanId))}"]`);
|
||||
rows.forEach(row => {
|
||||
// Remove the scan Id, its no longer being scanned.
|
||||
row.removeAttribute('data-scan-id');
|
||||
@@ -582,7 +617,7 @@
|
||||
|
||||
// Scan cancellation handler.
|
||||
const cancelledHandler = (progress) => {
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${progress.scanId}"]`);
|
||||
const rows = document.querySelectorAll(`tr[data-scan-id="${CSS.escape(String(progress.scanId))}"]`);
|
||||
rows.forEach(row => {
|
||||
// Remove the scan Id, its no longer being scanned.
|
||||
row.removeAttribute('data-scan-id');
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
@using Lumina.Presentation.Web.Common.DTO.Libraries
|
||||
@using Lumina.Presentation.Web.Common.Services
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@using System.Collections.Generic
|
||||
@using System.Text.Json
|
||||
|
||||
@{
|
||||
var id = Context.Request.RouteValues["id"] as string;
|
||||
@@ -27,7 +29,6 @@
|
||||
<form method="post" id="add-media-library-form" class="inline" novalidate>
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" asp-for="Id" value="@id" />
|
||||
<input type="hidden" asp-for="UserId" value="@Model.UserId"/>
|
||||
<div class="form-row">
|
||||
<h1 class="text-light-two w-100 text-center pt-0 pb-0 engraved-title">
|
||||
@(_localizer[id is not null ? "EditLibrary" : "AddNewLibrary"])
|
||||
@@ -271,8 +272,8 @@
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionPathTemplate"]</small>
|
||||
</div>
|
||||
</div>
|
||||
@if (id is not null)
|
||||
{
|
||||
<!-- The provider sections are shown for new and existing libraries alike, and only when the selected library type has providers of that kind. -->
|
||||
<div id="metadata-providers-section" class="hidden">
|
||||
<h3 class="text-light-two">@_localizer["MetadataProviders"]</h3>
|
||||
<div class="form-row">
|
||||
<table id="metadata-providers-table" class="w-100">
|
||||
@@ -289,6 +290,8 @@
|
||||
</table>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionMetadataProviders"]</small>
|
||||
</div>
|
||||
</div>
|
||||
<div id="artwork-providers-section" class="hidden">
|
||||
<h3 class="text-light-two">@_localizer["ArtworkProviders"]</h3>
|
||||
<div class="form-row">
|
||||
<table id="artwork-providers-table" class="w-100">
|
||||
@@ -305,6 +308,8 @@
|
||||
</table>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionArtworkProviders"]</small>
|
||||
</div>
|
||||
</div>
|
||||
<div id="book-readers-section" class="hidden">
|
||||
<h3 class="text-light-two">@_localizer["BookReaders"]</h3>
|
||||
<div class="form-row">
|
||||
<table id="book-readers-table" class="w-100">
|
||||
@@ -321,7 +326,7 @@
|
||||
</table>
|
||||
<small class="form-label text-disabled form-description">@_localizer["DescriptionBookReaders"]</small>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button type="submit" class="confirm-button w-100px">@_localizer["Save"]</button>
|
||||
</div>
|
||||
@@ -341,6 +346,23 @@
|
||||
// Create cleanup registry for this view.
|
||||
const cleanupFunctions = [];
|
||||
|
||||
// The localized labels of the rows built by this script, injected as JSON for the same reason as the path part labels below, and so that a translation
|
||||
// containing a backtick or "${" cannot break out of the template literals that render the rows.
|
||||
const rowLabels = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["remove"] = _localizer["Remove"].Value,
|
||||
["moveUp"] = _localizer["MoveUp"].Value,
|
||||
["moveDown"] = _localizer["MoveDown"].Value
|
||||
}));
|
||||
|
||||
// Escapes a value for use as text or as a quoted attribute value inside markup, since the chosen paths and the names, Ids and extensions of the providers
|
||||
// are not controlled by this page.
|
||||
function escapeHtml(value) {
|
||||
const div = document.createElement('div');
|
||||
div.textContent = value ?? '';
|
||||
return div.innerHTML.replace(/"/g, '"');
|
||||
}
|
||||
|
||||
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
|
||||
const saveSuccess = document.getElementById('save-success');
|
||||
const btnBackToLibraries = document.getElementById('btn-back-to-libraries');
|
||||
@@ -374,7 +396,6 @@
|
||||
const completionThresholdPercentage = inputCompletionThresholdPercentage.value.trim();
|
||||
const formData = {
|
||||
Id: form.querySelector('[name="Id"]').value || null,
|
||||
UserId: form.querySelector('[name="UserId"]').value || null,
|
||||
Title: form.querySelector('[name="Title"]').value,
|
||||
LibraryType: form.querySelector('#library-selected-item').getAttribute('data-value'),
|
||||
ContentLocations: Array.from(mediaDirectoriesFormTable.querySelectorAll('.form-table-row span'))
|
||||
@@ -404,7 +425,12 @@
|
||||
Representation: getPathTemplatePillRepresentation(pill),
|
||||
IsOptional: optional ? optional.checked : false
|
||||
};
|
||||
})
|
||||
}),
|
||||
// The provider choices are saved together with the library. A list that could not be loaded is sent as null, so the server keeps
|
||||
// or reconciles what it has, instead of being told that every provider was left out.
|
||||
MetadataProviders: areMetadataProvidersLoaded ? getProviderSelections(metadataProvidersTbody, 'metadata-provider-enabled') : null,
|
||||
ArtworkProviders: areArtworkProvidersLoaded ? getProviderSelections(artworkProvidersTbody, 'artwork-provider-enabled') : null,
|
||||
BookReaders: areBookReadersLoaded ? getProviderSelections(bookReadersTbody, 'book-reader-enabled') : null
|
||||
};
|
||||
const data = await callApiPostAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.SAVE_LIBRARY)', formData);
|
||||
if (data) {
|
||||
@@ -428,8 +454,8 @@
|
||||
if (!isDuplicate) {
|
||||
mediaDirectoriesFormTable.insertAdjacentHTML('beforeend', `
|
||||
<div class="form-table-row">
|
||||
<span title="${normalizedPath}">${normalizedPath}</span>
|
||||
<img src="/images/ui/delete.svg" alt="@_localizer["Remove"]" title="@_localizer["Remove"]" class="remove-form-table-row-icon" onclick="this.closest('.form-table-row').remove();" />
|
||||
<span title="${escapeHtml(normalizedPath)}">${escapeHtml(normalizedPath)}</span>
|
||||
<img src="/images/ui/delete.svg" alt="${escapeHtml(rowLabels.remove)}" title="${escapeHtml(rowLabels.remove)}" class="remove-form-table-row-icon" onclick="this.closest('.form-table-row').remove();" />
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
@@ -446,8 +472,8 @@
|
||||
const path = paths[0]; // Only use the first path.
|
||||
mediaCoverFormTable.insertAdjacentHTML('beforeend', `
|
||||
<div class="form-table-row">
|
||||
<span title="${path}">${path}</span>
|
||||
<img src="/images/ui/delete.svg" alt="@_localizer["Remove"]" title="@_localizer["Remove"]" class="remove-form-table-row-icon" onclick="this.closest('.form-table-row').remove();" />
|
||||
<span title="${escapeHtml(path)}">${escapeHtml(path)}</span>
|
||||
<img src="/images/ui/delete.svg" alt="${escapeHtml(rowLabels.remove)}" title="${escapeHtml(rowLabels.remove)}" class="remove-form-table-row-icon" onclick="this.closest('.form-table-row').remove();" />
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
@@ -494,169 +520,121 @@
|
||||
};
|
||||
|
||||
const id = '@id';
|
||||
const metadataProvidersTable = document.getElementById('metadata-providers-table');
|
||||
const metadataProvidersTbody = metadataProvidersTable ? metadataProvidersTable.querySelector('tbody') : null;
|
||||
const metadataProvidersSection = document.getElementById('metadata-providers-section');
|
||||
const metadataProvidersTbody = document.getElementById('metadata-providers-table').querySelector('tbody');
|
||||
const artworkProvidersSection = document.getElementById('artwork-providers-section');
|
||||
const artworkProvidersTbody = document.getElementById('artwork-providers-table').querySelector('tbody');
|
||||
const bookReadersSection = document.getElementById('book-readers-section');
|
||||
const bookReadersTbody = document.getElementById('book-readers-table').querySelector('tbody');
|
||||
// Whether each provider list was loaded for the selected library type. A list that failed to load is not sent when the library is saved.
|
||||
let areMetadataProvidersLoaded = false;
|
||||
let areArtworkProvidersLoaded = false;
|
||||
let areBookReadersLoaded = false;
|
||||
// Incremented on every load, so that the responses of a load started for a previously selected library type are discarded.
|
||||
let providersLoadVersion = 0;
|
||||
|
||||
// Loads the metadata providers configured for the library, when editing an existing library.
|
||||
async function loadMetadataProvidersAsync() {
|
||||
if (!id || !metadataProvidersTbody) return;
|
||||
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_METADATA_PROVIDERS, new { libraryId = default(Guid) })'
|
||||
.replace('/@(default(Guid))', `/${id}`); // The libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
|
||||
const response = await callApiGetAsync(url);
|
||||
if (response && response.length > 0) {
|
||||
metadataProvidersTbody.innerHTML = response.map((provider, index) => renderMetadataProviderRow(provider, index, response.length)).join('');
|
||||
// Loads the metadata providers, artwork providers and book readers of the selected library type. A new library lists the providers available for the
|
||||
// type, the way a new library of that type starts. An existing library merges its stored configuration with them, the same way the server reconciles
|
||||
// the configuration when the library is saved: the stored providers that the type still supports keep their state and order, the newly supported
|
||||
// ones are added disabled after them, and the stored providers that the type no longer supports are left out, so they are never submitted.
|
||||
async function loadProvidersAsync() {
|
||||
const libraryType = getSelectedLibraryType();
|
||||
const loadVersion = ++providersLoadVersion;
|
||||
areMetadataProvidersLoaded = false;
|
||||
areArtworkProvidersLoaded = false;
|
||||
areBookReadersLoaded = false;
|
||||
if (!libraryType) {
|
||||
renderProviders(null, null, null);
|
||||
return;
|
||||
}
|
||||
// The Id and the type need to be replaced here, because GetAbsoluteUrl is server side, while the library Id and the selected type are client side.
|
||||
const encodedLibraryType = encodeURIComponent(libraryType);
|
||||
const requests = [
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_METADATA_PROVIDERS, new { libraryType = "Book" })'.replace('/Book', `/${encodedLibraryType}`)),
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_ARTWORK_PROVIDERS, new { libraryType = "Book" })'.replace('/Book', `/${encodedLibraryType}`)),
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_LIBRARY_TYPE_BOOK_READERS, new { libraryType = "Book" })'.replace('/Book', `/${encodedLibraryType}`))
|
||||
];
|
||||
if (id) {
|
||||
requests.push(
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_METADATA_PROVIDERS, new { libraryId = default(Guid) })'.replace('/@(default(Guid))', `/${id}`)),
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_ARTWORK_PROVIDERS, new { libraryId = default(Guid) })'.replace('/@(default(Guid))', `/${id}`)),
|
||||
callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_BOOK_READERS, new { libraryId = default(Guid) })'.replace('/@(default(Guid))', `/${id}`)));
|
||||
}
|
||||
const [availableMetadataProviders, availableArtworkProviders, availableBookReaders, storedMetadataProviders, storedArtworkProviders, storedBookReaders] = await Promise.all(requests);
|
||||
if (loadVersion !== providersLoadVersion)
|
||||
return;
|
||||
if (!id) {
|
||||
renderProviders(availableMetadataProviders, availableArtworkProviders, availableBookReaders);
|
||||
return;
|
||||
}
|
||||
renderProviders(
|
||||
mergeStoredProviders(availableMetadataProviders, storedMetadataProviders),
|
||||
mergeStoredProviders(availableArtworkProviders, storedArtworkProviders),
|
||||
mergeStoredProviders(availableBookReaders, storedBookReaders));
|
||||
}
|
||||
|
||||
// Renders a metadata provider row of the library.
|
||||
function renderMetadataProviderRow(provider, index, count) {
|
||||
// Merges the stored configuration of a library with the providers available for the selected type. Returns null when either list could not be
|
||||
// loaded, so that the list is not submitted and the server keeps what it has. An empty list of available providers is treated the same way:
|
||||
// while stored providers exist, it means that no loaded plugin currently reports support for the type, not that the user left every provider
|
||||
// out. Submitting it would tell the server that the whole list is a choice, which deletes the stored rows along with their enablement and
|
||||
// order, and the next plugin sync would re-add them disabled.
|
||||
function mergeStoredProviders(availableProviders, storedProviders) {
|
||||
if (!Array.isArray(availableProviders) || !Array.isArray(storedProviders))
|
||||
return null;
|
||||
if (availableProviders.length === 0 && storedProviders.length > 0)
|
||||
return null;
|
||||
const availableProvidersById = new Map(availableProviders.map(provider => [provider.pluginId, provider]));
|
||||
const keptProviders = storedProviders
|
||||
.filter(provider => availableProvidersById.has(provider.pluginId))
|
||||
.sort((first, second) => (first.rank ?? 0) - (second.rank ?? 0))
|
||||
.map(provider => ({ ...availableProvidersById.get(provider.pluginId), isEnabled: provider.isEnabled }));
|
||||
const keptPluginIds = new Set(keptProviders.map(provider => provider.pluginId));
|
||||
return keptProviders.concat(availableProviders.filter(provider => !keptPluginIds.has(provider.pluginId)));
|
||||
}
|
||||
|
||||
// Renders the provider lists, and shows only the sections whose list has at least one provider.
|
||||
function renderProviders(metadataProviders, artworkProviders, bookReaders) {
|
||||
areMetadataProvidersLoaded = Array.isArray(metadataProviders);
|
||||
areArtworkProvidersLoaded = Array.isArray(artworkProviders);
|
||||
areBookReadersLoaded = Array.isArray(bookReaders);
|
||||
const metadataProviderRows = areMetadataProvidersLoaded ? metadataProviders : [];
|
||||
const artworkProviderRows = areArtworkProvidersLoaded ? artworkProviders : [];
|
||||
const bookReaderRows = areBookReadersLoaded ? bookReaders : [];
|
||||
metadataProvidersTbody.innerHTML = metadataProviderRows.map(provider => renderRankedProviderRow(provider, 'metadata-provider')).join('');
|
||||
artworkProvidersTbody.innerHTML = artworkProviderRows.map(provider => renderRankedProviderRow(provider, 'artwork-provider')).join('');
|
||||
bookReadersTbody.innerHTML = bookReaderRows.map(reader => renderBookReaderRow(reader)).join('');
|
||||
refreshMoveButtons(metadataProvidersTbody, 'metadata-provider');
|
||||
refreshMoveButtons(artworkProvidersTbody, 'artwork-provider');
|
||||
metadataProvidersSection.classList.toggle('hidden', metadataProviderRows.length === 0);
|
||||
artworkProvidersSection.classList.toggle('hidden', artworkProviderRows.length === 0);
|
||||
bookReadersSection.classList.toggle('hidden', bookReaderRows.length === 0);
|
||||
}
|
||||
|
||||
// Renders a metadata or artwork provider row, whose position in the table is the order in which the provider is tried.
|
||||
function renderRankedProviderRow(provider, classPrefix) {
|
||||
return `
|
||||
<tr data-provider-plugin-id="${provider.pluginId}">
|
||||
<td>${provider.name}</td>
|
||||
<tr data-plugin-id="${escapeHtml(provider.pluginId)}">
|
||||
<td>${escapeHtml(provider.name)}</td>
|
||||
<td class="text-center">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" class="enlightenment-checkbox-hidden metadata-provider-enabled" ${provider.isEnabled ? 'checked' : ''} />
|
||||
<input type="checkbox" class="enlightenment-checkbox-hidden ${classPrefix}-enabled" ${provider.isEnabled ? 'checked' : ''} />
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="metadata-provider-move-up confirm-button f-12 h-20px" ${index === 0 ? 'disabled' : ''}>@_localizer["MoveUp"]</button>
|
||||
<button type="button" class="metadata-provider-move-down abort-button f-12 h-20px" ${index === count - 1 ? 'disabled' : ''}>@_localizer["MoveDown"]</button>
|
||||
<button type="button" class="${classPrefix}-move-up confirm-button f-12 h-20px">${escapeHtml(rowLabels.moveUp)}</button>
|
||||
<button type="button" class="${classPrefix}-move-down abort-button f-12 h-20px">${escapeHtml(rowLabels.moveDown)}</button>
|
||||
</td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
// On metadata provider move button click, reorders the providers and persists the new order.
|
||||
async function handleMetadataProviderReorderAsync(e) {
|
||||
const button = e.target.closest('.metadata-provider-move-up, .metadata-provider-move-down');
|
||||
if (!button || !metadataProvidersTbody) return;
|
||||
const row = button.closest('tr');
|
||||
if (button.classList.contains('metadata-provider-move-up')) {
|
||||
const previousRow = row.previousElementSibling;
|
||||
if (previousRow) metadataProvidersTbody.insertBefore(row, previousRow);
|
||||
} else {
|
||||
const nextRow = row.nextElementSibling;
|
||||
if (nextRow) metadataProvidersTbody.insertBefore(nextRow, row);
|
||||
}
|
||||
await saveMetadataProviderOrderAsync();
|
||||
}
|
||||
|
||||
// Persists the current order of the metadata providers of the library.
|
||||
async function saveMetadataProviderOrderAsync() {
|
||||
if (!id || !metadataProvidersTbody) return;
|
||||
const pluginIds = Array.from(metadataProvidersTbody.querySelectorAll('tr[data-provider-plugin-id]'))
|
||||
.map(row => row.getAttribute('data-provider-plugin-id'));
|
||||
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.REORDER_METADATA_PROVIDERS)', { libraryId: id, pluginIds: pluginIds });
|
||||
if (result.success) {
|
||||
notificationService.show('@_localizer["OrderSaved"]', NotificationType.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
// On metadata provider enabled checkbox change, persists the new state.
|
||||
async function handleMetadataProviderEnabledChangeAsync(e) {
|
||||
if (e.target.matches('.metadata-provider-enabled')) {
|
||||
const row = e.target.closest('tr');
|
||||
const pluginId = row.getAttribute('data-provider-plugin-id');
|
||||
const isEnabled = e.target.checked;
|
||||
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.SET_METADATA_PROVIDER_ENABLED)', { libraryId: id, pluginId: pluginId, isEnabled: isEnabled });
|
||||
if (!result.success) {
|
||||
e.target.checked = !isEnabled;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const artworkProvidersTable = document.getElementById('artwork-providers-table');
|
||||
const artworkProvidersTbody = artworkProvidersTable ? artworkProvidersTable.querySelector('tbody') : null;
|
||||
|
||||
// Loads the artwork providers configured for the library, when editing an existing library.
|
||||
async function loadArtworkProvidersAsync() {
|
||||
if (!id || !artworkProvidersTbody) return;
|
||||
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_ARTWORK_PROVIDERS, new { libraryId = default(Guid) })'
|
||||
.replace('/@(default(Guid))', `/${id}`); // The libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
|
||||
const response = await callApiGetAsync(url);
|
||||
if (response && response.length > 0) {
|
||||
artworkProvidersTbody.innerHTML = response.map((provider, index) => renderArtworkProviderRow(provider, index, response.length)).join('');
|
||||
}
|
||||
}
|
||||
|
||||
// Renders an artwork provider row of the library.
|
||||
function renderArtworkProviderRow(provider, index, count) {
|
||||
return `
|
||||
<tr data-provider-plugin-id="${provider.pluginId}">
|
||||
<td>${provider.name}</td>
|
||||
<td class="text-center">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" class="enlightenment-checkbox-hidden artwork-provider-enabled" ${provider.isEnabled ? 'checked' : ''} />
|
||||
<span class="enlightenment-checkbox"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="artwork-provider-move-up confirm-button f-12 h-20px" ${index === 0 ? 'disabled' : ''}>@_localizer["MoveUp"]</button>
|
||||
<button type="button" class="artwork-provider-move-down abort-button f-12 h-20px" ${index === count - 1 ? 'disabled' : ''}>@_localizer["MoveDown"]</button>
|
||||
</td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
// On artwork provider move button click, reorders the providers and persists the new order.
|
||||
async function handleArtworkProviderReorderAsync(e) {
|
||||
const button = e.target.closest('.artwork-provider-move-up, .artwork-provider-move-down');
|
||||
if (!button || !artworkProvidersTbody) return;
|
||||
const row = button.closest('tr');
|
||||
if (button.classList.contains('artwork-provider-move-up')) {
|
||||
const previousRow = row.previousElementSibling;
|
||||
if (previousRow) artworkProvidersTbody.insertBefore(row, previousRow);
|
||||
} else {
|
||||
const nextRow = row.nextElementSibling;
|
||||
if (nextRow) artworkProvidersTbody.insertBefore(nextRow, row);
|
||||
}
|
||||
await saveArtworkProviderOrderAsync();
|
||||
}
|
||||
|
||||
// Persists the current order of the artwork providers of the library.
|
||||
async function saveArtworkProviderOrderAsync() {
|
||||
if (!id || !artworkProvidersTbody) return;
|
||||
const pluginIds = Array.from(artworkProvidersTbody.querySelectorAll('tr[data-provider-plugin-id]'))
|
||||
.map(row => row.getAttribute('data-provider-plugin-id'));
|
||||
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.REORDER_ARTWORK_PROVIDERS)', { libraryId: id, pluginIds: pluginIds });
|
||||
if (result.success) {
|
||||
notificationService.show('@_localizer["OrderSaved"]', NotificationType.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
// On artwork provider enabled checkbox change, persists the new state.
|
||||
async function handleArtworkProviderEnabledChangeAsync(e) {
|
||||
if (e.target.matches('.artwork-provider-enabled')) {
|
||||
const row = e.target.closest('tr');
|
||||
const pluginId = row.getAttribute('data-provider-plugin-id');
|
||||
const isEnabled = e.target.checked;
|
||||
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.SET_ARTWORK_PROVIDER_ENABLED)', { libraryId: id, pluginId: pluginId, isEnabled: isEnabled });
|
||||
if (!result.success) {
|
||||
e.target.checked = !isEnabled;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const bookReadersTable = document.getElementById('book-readers-table');
|
||||
const bookReadersTbody = bookReadersTable ? bookReadersTable.querySelector('tbody') : null;
|
||||
|
||||
// Loads the book readers configured for the library, when editing an existing library.
|
||||
async function loadBookReadersAsync() {
|
||||
if (!id || !bookReadersTbody) return;
|
||||
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_BOOK_READERS, new { libraryId = default(Guid) })'
|
||||
.replace('/@(default(Guid))', `/${id}`); // The libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
|
||||
const response = await callApiGetAsync(url);
|
||||
if (response && response.length > 0) {
|
||||
bookReadersTbody.innerHTML = response.map(reader => renderBookReaderRow(reader)).join('');
|
||||
}
|
||||
}
|
||||
|
||||
// Renders a book reader row of the library.
|
||||
// Renders a book reader row.
|
||||
function renderBookReaderRow(reader) {
|
||||
const extensions = (reader.supportedExtensions || []).join(', ');
|
||||
return `
|
||||
<tr data-reader-plugin-id="${reader.pluginId}">
|
||||
<td>${reader.name}</td>
|
||||
<td>${extensions}</td>
|
||||
<tr data-plugin-id="${escapeHtml(reader.pluginId)}">
|
||||
<td>${escapeHtml(reader.name)}</td>
|
||||
<td>${escapeHtml(extensions)}</td>
|
||||
<td class="text-center">
|
||||
<label class="enlightenment-checkbox-label">
|
||||
<input type="checkbox" class="enlightenment-checkbox-hidden book-reader-enabled" ${reader.isEnabled ? 'checked' : ''} />
|
||||
@@ -666,19 +644,48 @@
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
// On book reader enabled checkbox change, persists the new state.
|
||||
async function handleBookReaderEnabledChangeAsync(e) {
|
||||
if (e.target.matches('.book-reader-enabled')) {
|
||||
const row = e.target.closest('tr');
|
||||
const pluginId = row.getAttribute('data-reader-plugin-id');
|
||||
const isEnabled = e.target.checked;
|
||||
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.SET_BOOK_READER_ENABLED)', { libraryId: id, pluginId: pluginId, isEnabled: isEnabled });
|
||||
if (!result.success) {
|
||||
e.target.checked = !isEnabled;
|
||||
}
|
||||
// Disables the move up button of the first row and the move down button of the last row, and enables all the others.
|
||||
function refreshMoveButtons(tbody, classPrefix) {
|
||||
const rows = Array.from(tbody.querySelectorAll('tr[data-plugin-id]'));
|
||||
rows.forEach((row, index) => {
|
||||
row.querySelector(`.${classPrefix}-move-up`).disabled = index === 0;
|
||||
row.querySelector(`.${classPrefix}-move-down`).disabled = index === rows.length - 1;
|
||||
});
|
||||
}
|
||||
|
||||
// Moves the provider row of the clicked move button one position up or down. The new order is saved together with the library.
|
||||
function moveProviderRow(e, tbody, classPrefix) {
|
||||
const button = e.target.closest(`.${classPrefix}-move-up, .${classPrefix}-move-down`);
|
||||
if (!button) return;
|
||||
const row = button.closest('tr');
|
||||
if (button.classList.contains(`${classPrefix}-move-up`)) {
|
||||
const previousRow = row.previousElementSibling;
|
||||
if (previousRow) tbody.insertBefore(row, previousRow);
|
||||
} else {
|
||||
const nextRow = row.nextElementSibling;
|
||||
if (nextRow) tbody.insertBefore(nextRow, row);
|
||||
}
|
||||
refreshMoveButtons(tbody, classPrefix);
|
||||
}
|
||||
|
||||
// On metadata provider move button click, moves the provider.
|
||||
const handleMetadataProviderMove = function(e) {
|
||||
moveProviderRow(e, metadataProvidersTbody, 'metadata-provider');
|
||||
};
|
||||
|
||||
// On artwork provider move button click, moves the provider.
|
||||
const handleArtworkProviderMove = function(e) {
|
||||
moveProviderRow(e, artworkProvidersTbody, 'artwork-provider');
|
||||
};
|
||||
|
||||
// Gets the choices made in a provider table, in the order of its rows.
|
||||
function getProviderSelections(tbody, enabledCheckboxClass) {
|
||||
return Array.from(tbody.querySelectorAll('tr[data-plugin-id]')).map(row => ({
|
||||
PluginId: row.getAttribute('data-plugin-id'),
|
||||
IsEnabled: row.querySelector(`.${enabledCheckboxClass}`).checked
|
||||
}));
|
||||
}
|
||||
|
||||
// The default completion threshold of each library type that tracks consumption progress by default. It mirrors
|
||||
// LibraryConsumptionSettings.CreateDefault(LibraryType) in the domain, so the two must be kept in sync.
|
||||
const defaultCompletionThresholds = {
|
||||
@@ -762,13 +769,15 @@
|
||||
const libraryTypeSelectedItem = document.getElementById('library-selected-item');
|
||||
// The type the library was loaded with, so that the saved template is only restored for it, and not when the user previews other types.
|
||||
const initialLibraryType = libraryTypeSelectedItem ? libraryTypeSelectedItem.getAttribute('data-value') : null;
|
||||
// The type whose path template and providers are currently shown, so that picking the same type again keeps the unsaved edits of the form.
|
||||
let shownLibraryType = initialLibraryType;
|
||||
const libraryTypeDropdown = form.querySelector('.enlightenment-combobox .enlightenment-dropdown');
|
||||
const pathSeparator = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(System.IO.Path.DirectorySeparatorChar.ToString()));
|
||||
const savedPathTemplateParts = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model.PathTemplateParts, new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }));
|
||||
const pathSeparator = @Html.Raw(JsonSerializer.Serialize(System.IO.Path.DirectorySeparatorChar.ToString()));
|
||||
const savedPathTemplateParts = @Html.Raw(JsonSerializer.Serialize(Model.PathTemplateParts, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }));
|
||||
// The localized strings used inside this script must be injected as JSON, not as raw HTML text: Razor HTML-encodes non-ASCII
|
||||
// characters into numeric entities (e.g. "ă" becomes "ă"), and the browser does not decode entities inside a
|
||||
// script element, so they would show up literally. JSON escapes them as \uXXXX, which the script reads correctly.
|
||||
const pathPartLabels = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(new System.Collections.Generic.Dictionary<string, string>
|
||||
const pathPartLabels = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["Literal"] = _localizer["PathPartLiteral"].Value,
|
||||
["Separator"] = _localizer["PathPartSeparator"].Value,
|
||||
@@ -786,7 +795,7 @@
|
||||
["SeriesNumber"] = _localizer["PathPartSeriesNumber"].Value,
|
||||
["BookId"] = _localizer["PathPartBookId"].Value
|
||||
}));
|
||||
const pathTemplateStrings = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(new System.Collections.Generic.Dictionary<string, string>
|
||||
const pathTemplateStrings = @Html.Raw(JsonSerializer.Serialize(new Dictionary<string, string>
|
||||
{
|
||||
["optional"] = _localizer["PathPartOptional"].Value,
|
||||
["remove"] = _localizer["Remove"].Value,
|
||||
@@ -1086,7 +1095,14 @@
|
||||
const option = e.target.closest('.enlightenment-option');
|
||||
if (!option || option.classList.contains('disabled') || !option.getAttribute('data-value')) return;
|
||||
setTimeout(() => {
|
||||
// Picking the type that is already selected changes nothing, so the path template, the provider choices and the consumption settings
|
||||
// edited since are kept, instead of being reloaded and lost.
|
||||
const libraryType = getSelectedLibraryType();
|
||||
if (libraryType === shownLibraryType) return;
|
||||
shownLibraryType = libraryType;
|
||||
loadPathTemplateAsync();
|
||||
// The provider tables always list the providers relevant to the selected type, so they are reloaded with it.
|
||||
loadProvidersAsync();
|
||||
// A new library starts from the default consumption settings of its type. An existing library keeps the settings it was loaded with.
|
||||
if (!id)
|
||||
applyDefaultConsumptionSettings();
|
||||
@@ -1109,17 +1125,8 @@
|
||||
pathTemplateDropzone.addEventListener('drop', handlePathTemplateDrop);
|
||||
pathTemplateDropzone.addEventListener('dragleave', handlePathTemplateDragLeave);
|
||||
if (libraryTypeDropdown) libraryTypeDropdown.addEventListener('click', handleLibraryTypeChange);
|
||||
if (metadataProvidersTbody) {
|
||||
metadataProvidersTbody.addEventListener('click', handleMetadataProviderReorderAsync);
|
||||
metadataProvidersTbody.addEventListener('change', handleMetadataProviderEnabledChangeAsync);
|
||||
}
|
||||
if (artworkProvidersTbody) {
|
||||
artworkProvidersTbody.addEventListener('click', handleArtworkProviderReorderAsync);
|
||||
artworkProvidersTbody.addEventListener('change', handleArtworkProviderEnabledChangeAsync);
|
||||
}
|
||||
if (bookReadersTbody) {
|
||||
bookReadersTbody.addEventListener('change', handleBookReaderEnabledChangeAsync);
|
||||
}
|
||||
metadataProvidersTbody.addEventListener('click', handleMetadataProviderMove);
|
||||
artworkProvidersTbody.addEventListener('click', handleArtworkProviderMove);
|
||||
|
||||
// Register cleanup for these listeners.
|
||||
cleanupFunctions.push(() => {
|
||||
@@ -1138,25 +1145,12 @@
|
||||
pathTemplateDropzone.removeEventListener('drop', handlePathTemplateDrop);
|
||||
pathTemplateDropzone.removeEventListener('dragleave', handlePathTemplateDragLeave);
|
||||
if (libraryTypeDropdown) libraryTypeDropdown.removeEventListener('click', handleLibraryTypeChange);
|
||||
if (metadataProvidersTbody) {
|
||||
metadataProvidersTbody.removeEventListener('click', handleMetadataProviderReorderAsync);
|
||||
metadataProvidersTbody.removeEventListener('change', handleMetadataProviderEnabledChangeAsync);
|
||||
}
|
||||
if (artworkProvidersTbody) {
|
||||
artworkProvidersTbody.removeEventListener('click', handleArtworkProviderReorderAsync);
|
||||
artworkProvidersTbody.removeEventListener('change', handleArtworkProviderEnabledChangeAsync);
|
||||
}
|
||||
if (bookReadersTbody) {
|
||||
bookReadersTbody.removeEventListener('change', handleBookReaderEnabledChangeAsync);
|
||||
}
|
||||
metadataProvidersTbody.removeEventListener('click', handleMetadataProviderMove);
|
||||
artworkProvidersTbody.removeEventListener('click', handleArtworkProviderMove);
|
||||
});
|
||||
|
||||
// Load the metadata and artwork providers and book readers when editing an existing library.
|
||||
if (id) {
|
||||
loadMetadataProvidersAsync();
|
||||
loadArtworkProvidersAsync();
|
||||
loadBookReadersAsync();
|
||||
}
|
||||
// Load the metadata providers, artwork providers and book readers of the selected library type, for both new and existing libraries.
|
||||
loadProvidersAsync();
|
||||
|
||||
// Load the path template of the selected library type, and its default, for both new and existing libraries.
|
||||
loadPathTemplateAsync();
|
||||
|
||||
Reference in new issue
Block a user