Adds book reading support with EPUB and PDF reader plugins

This commit is contained in:
BinaryAlley committed 2026-09-02 04:45:11 -07:00
1 parent 275fd83ff2
commit f7ccdf3d1c
271 files changed
+11501 -361

No files matched your search

@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
/// <summary>
/// Data transfer object for a book reader configured for a media library.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class LibraryBookReaderDto
{
/// <summary>
/// Gets or sets the unique identifier of the plugin providing the book reader.
/// </summary>
public Guid PluginId { get; set; }
/// <summary>
/// Gets or sets the display name of the book reader.
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the file extensions supported by the book reader.
/// </summary>
public List<string> SupportedExtensions { get; set; } = [];
/// <summary>
/// Gets or sets whether the book reader is enabled for the media library.
/// </summary>
public bool IsEnabled { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Reading;
/// <summary>
/// Data transfer object for the reading availability of a book.
/// </summary>
[DebuggerDisplay("BookId: {BookId}, IsAvailable: {IsAvailable}")]
public class ReadingAvailabilityDto
{
/// <summary>
/// Gets or sets the Id of the book whose reading availability is reported.
/// </summary>
public Guid BookId { get; set; }
/// <summary>
/// Gets or sets the Id of the media library the book belongs to.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets whether the book can be opened for reading.
/// </summary>
public bool IsAvailable { get; set; }
/// <summary>
/// Gets or sets the code of the error preventing the book from being read, when it cannot be read. Can be <see langword="null"/> when the book is available.
/// </summary>
public string? ErrorCode { get; set; }
}
@@ -0,0 +1,48 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Reading;
/// <summary>
/// Data transfer object for the reading manifest of a book.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class ReadingManifestDto
{
/// <summary>
/// Gets or sets the title of the book.
/// </summary>
public string Title { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the author of the book, if known.
/// </summary>
public string? Author { get; set; }
/// <summary>
/// Gets or sets the resource key of the cover image of the book, if applicable.
/// </summary>
public string? CoverResourceKey { get; set; }
/// <summary>
/// Gets or sets the hierarchical table of contents of the book.
/// </summary>
public List<ReadingTocEntryDto> TableOfContents { get; set; } = [];
/// <summary>
/// Gets or sets the ordered spine of the reading sections of the book.
/// </summary>
public List<ReadingSpineItemDto> Spine { get; set; } = [];
/// <summary>
/// Gets or sets the resource keys of the resources of the book.
/// </summary>
public List<string> ResourceKeys { get; set; } = [];
/// <summary>
/// Gets or sets whether the book has extractable text content. A scanned book, whose pages are only images, has no text content.
/// </summary>
public bool HasTextContent { get; set; }
}
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Reading;
/// <summary>
/// Data transfer object for the content of a reading section of a book.
/// </summary>
[DebuggerDisplay("LocationRef: {LocationRef}")]
public class ReadingSectionDto
{
/// <summary>
/// Gets or sets the opaque location reference of the reading section.
/// </summary>
public string LocationRef { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the title of the reading section, if known.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Gets or sets the sanitized HTML content of the reading section, ready to be rendered by the client.
/// </summary>
public string ContentHtml { get; set; } = string.Empty;
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Reading;
/// <summary>
/// Data transfer object for an item of the spine of the reading manifest of a book.
/// </summary>
[DebuggerDisplay("LocationRef: {LocationRef}")]
public class ReadingSpineItemDto
{
/// <summary>
/// Gets or sets the opaque location reference of the reading section.
/// </summary>
public string LocationRef { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the title of the reading section, if known.
/// </summary>
public string? Title { get; set; }
}
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Reading;
/// <summary>
/// Data transfer object for an entry of the table of contents of the reading manifest of a book.
/// </summary>
[DebuggerDisplay("Label: {Label}")]
public class ReadingTocEntryDto
{
/// <summary>
/// Gets or sets the label of the table of contents entry.
/// </summary>
public string Label { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the opaque location reference of the reading section the entry points to.
/// </summary>
public string LocationRef { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the child entries of the table of contents entry.
/// </summary>
public List<ReadingTocEntryDto> Children { get; set; } = [];
}
@@ -40,4 +40,17 @@ public class UserSettingsDto
/// Gets or sets whether the metadata of the media library items is aggregated from multiple providers, when fields are missing, or not.
/// </summary>
public bool ShouldAggregateMetadataWhenMissing { get; set; }
/// <summary>
/// Gets or sets whether PDF books are rendered as page images for the user, or not. Rendering PDFs as images preserves the
/// original layout, but the pages are not selectable or searchable, unlike their text layer.
/// </summary>
public bool ShouldRenderPdfAsImages { get; set; }
/// <summary>
/// Gets or sets whether the styles of the book content are preserved when it is rendered for the user, or not. Preserving them
/// keeps the original look of a book (its fonts, colors, and alignment), but the styles of a book can load resources from
/// external servers, which those servers could observe; stripping them removes that possibility, at the cost of the look of the book.
/// </summary>
public bool ShouldPreserveBookStyles { get; set; }
}
@@ -9,7 +9,6 @@ using Lumina.Presentation.Web.Common.Http;
using Lumina.Presentation.Web.Common.Localization;
using Lumina.Presentation.Web.Common.Security;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Common.Validation;
using Lumina.Presentation.Web.Core.Themes;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
@@ -19,7 +18,6 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Localization.Routing;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Localization;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection;
@@ -40,13 +38,13 @@ using System.Threading.Tasks;
namespace Lumina.Presentation.Web.Common.DependencyInjection;
/// <summary>
/// Contains all services of the Presentation Web layer.
/// Utility class for registering the services of the Presentation Web layer into the Dependency Injection container.
/// </summary>
[ExcludeFromCodeCoverage]
public static class PresentationWebLayerServices
{
/// <summary>
/// Registers the services of the Presentation Web layer into the dependency injection container.
/// Registers the services of the Presentation Web layer into the Dependency Injection container.
/// </summary>
/// <param name="services">The service collection to add the services to.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
@@ -58,11 +56,11 @@ public static class PresentationWebLayerServices
.AddJsonOptions(jsonOptions =>
{
jsonOptions.JsonSerializerOptions.MaxDepth = 256;
jsonOptions.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles; // needed because file system API responses can have very nested structures
jsonOptions.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles; // Needed because file system API responses can have very nested structures.
jsonOptions.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
// configure the locations where the Razor view engine looks for views and layouts, since the views live under the Core directory
// Configure the locations where the Razor view engine looks for views and layouts, since the views live under the Core directory.
services.Configure<RazorViewEngineOptions>(razorViewEngineOptions =>
{
razorViewEngineOptions.ViewLocationFormats.Clear();
@@ -70,17 +68,17 @@ public static class PresentationWebLayerServices
razorViewEngineOptions.ViewLocationFormats.Add("/Core/Views/Shared/{0}.cshtml");
});
// configure the JSON serialization settings used by Results.Json, so that the JSON responses of the endpoints match the MVC responses they replace
// Configure the JSON serialization settings used by Results.Json, so that the JSON responses of the endpoints match the MVC responses they replace.
services.Configure<Microsoft.AspNetCore.Http.Json.JsonOptions>(jsonOptions =>
{
jsonOptions.SerializerOptions.MaxDepth = 256;
jsonOptions.SerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles; // needed because file system API responses can have very nested structures
jsonOptions.SerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles; // Needed because file system API responses can have very nested structures.
jsonOptions.SerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
// register the FastEndpoints library, which replaces the MVC controllers for handling the application routes
// Register the FastEndpoints library, which replaces the MVC controllers for handling the application routes.
services.AddFastEndpoints();
// add OpenAPI document generation, so that the endpoints exposed by the web application are discoverable and their contracts are visible
// Add OpenAPI document generation, so that the endpoints exposed by the web application are discoverable and their contracts are visible.
services.AddOpenApi();
services.SwaggerDocument(documentOptions =>
{
@@ -98,9 +96,9 @@ public static class PresentationWebLayerServices
documentOptions.RemoveEmptyRequestSchema = true;
documentOptions.ShortSchemaNames = true;
});
// configure URL-based localization
// Configure URL-based localization.
services.AddLocalization(localizationOptions => localizationOptions.ResourcesPath = "Core/Resources");
// resolve the resources of the views that live under the Core/Views directory
// Resolve the resources of the views that live under the Core/Views directory.
services.AddSingleton<IHtmlLocalizerFactory, CoreHtmlLocalizerFactory>();
services.Configure<RequestLocalizationOptions>(requestLocalizationOptions =>
@@ -122,57 +120,57 @@ public static class PresentationWebLayerServices
requestLocalizationOptions.SupportedCultures = supportedCultures;
requestLocalizationOptions.SupportedUICultures = supportedCultures;
// configure route-based culture provider
// Configure route-based culture provider.
RouteDataRequestCultureProvider routeDataRequestCultureProvider = new()
{
RouteDataStringKey = "culture",
UIRouteDataStringKey = "culture",
Options = requestLocalizationOptions
};
// make the route culture provider the first one to be evaluated
// Make the route culture provider the first one to be evaluated.
requestLocalizationOptions.RequestCultureProviders =
[
routeDataRequestCultureProvider, // keep route-based culture handling
new CookieRequestCultureProvider(), // but also add cookie option, so the application "remembers" the last used language the next time it's opened
routeDataRequestCultureProvider, // Keep route-based culture handling,
new CookieRequestCultureProvider(), // but also add cookie option, so the application "remembers" the last used language the next time it's opened.
new AcceptLanguageHeaderRequestCultureProvider()
];
});
// configure cookie-based authentication
// Configure cookie-based authentication.
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(cookieAuthenticationOptions =>
{
// basic path configuration
// Basic path configuration.
cookieAuthenticationOptions.LoginPath = "/auth/login";
cookieAuthenticationOptions.LogoutPath = "/auth/logout";
cookieAuthenticationOptions.AccessDeniedPath = "/auth/access-denied";
// cookie configuration
// Cookie configuration.
cookieAuthenticationOptions.Cookie = new CookieBuilder
{
Name = ".Lumina.Auth", // unique name to avoid conflicts
HttpOnly = true, // prevent JavaScript access
Name = ".Lumina.Auth", // Unique name to avoid conflicts.
HttpOnly = true, // Prevent JavaScript access.
SameSite = SameSiteMode.Strict,
SecurePolicy = CookieSecurePolicy.Always, // require HTTPS
Path = "/", // make cookie available for all paths
IsEssential = true // mark as essential for GDPR
SecurePolicy = CookieSecurePolicy.Always, // Require HTTPS.
Path = "/", // Make cookie available for all paths.
IsEssential = true // Mark as essential for GDPR.
};
// security settings
// Security settings.
cookieAuthenticationOptions.ExpireTimeSpan = TimeSpan.FromHours(24); // TODO: perhaps make it configurable by user?
cookieAuthenticationOptions.SlidingExpiration = true;
// handle validation to support various deployment scenarios
// Handle validation to support various deployment scenarios.
cookieAuthenticationOptions.Events = new CookieAuthenticationEvents
{
// handle redirects to work with different base paths
// Handle redirects to work with different base paths.
OnRedirectToLogin = redirectContext =>
{
HttpContext httpContext = redirectContext.HttpContext;
string culture = httpContext.Request.RouteValues["culture"]?.ToString()?.ToLower() ?? "en-us";
string? lastDisplayedView = httpContext.Session.GetString(HttpContextItemKeys.LAST_DISPLAYED_VIEW);
// build the login path considering reverse proxy and subfolder scenarios
// Build the login path considering reverse proxy and subfolder scenarios.
string? originalHost = httpContext.Request.Headers["X-Forwarded-Host"].FirstOrDefault() ?? httpContext.Request.Host.Value;
string? originalScheme = httpContext.Request.Headers["X-Forwarded-Proto"].FirstOrDefault() ?? httpContext.Request.Scheme;
string? originalPathBase = httpContext.Request.Headers["X-Forwarded-Prefix"].FirstOrDefault() ?? httpContext.Request.PathBase.Value;
@@ -226,8 +224,8 @@ public static class PresentationWebLayerServices
};
});
// add authorization policies that ensure the application is initialized with the super admin account before allowing access,
// and that restrict access based on the roles and permissions retrieved from the remote API
// Add authorization policies that ensure the application is initialized with the super admin account before allowing access,
// and that restrict access based on the roles and permissions retrieved from the remote API.
services.AddAuthorizationBuilder()
.AddPolicy(AuthorizationPolicies.REQUIRE_INITIALIZATION, authorizationPolicyBuilder => authorizationPolicyBuilder.Requirements.Add(new InitializationRequirement()))
.AddPolicy(AuthorizationPolicies.REQUIRE_ADMIN_ROLE, authorizationPolicyBuilder =>
@@ -241,7 +239,7 @@ public static class PresentationWebLayerServices
authorizationPolicyBuilder.RequireAuthenticatedUser();
});
// add forwarded headers middleware to handle reverse proxy scenarios
// Add forwarded headers middleware to handle reverse proxy scenarios.
services.Configure<ForwardedHeadersOptions>(forwardedHeadersOptions =>
{
forwardedHeadersOptions.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost;
@@ -249,15 +247,15 @@ public static class PresentationWebLayerServices
forwardedHeadersOptions.KnownProxies.Clear();
});
// configure session management to maintain user-specific data across requests
// Configure session management to maintain user-specific data across requests.
services.AddSession(sessionOptions =>
{
sessionOptions.IdleTimeout = TimeSpan.FromMinutes(30); // session expires after 30 minutes of inactivity
sessionOptions.Cookie.HttpOnly = true; // prevent JavaScript access to session cookie, for security
sessionOptions.Cookie.IsEssential = true; // mark session cookie as essential, for GDPR compliance
sessionOptions.IdleTimeout = TimeSpan.FromMinutes(30); // Session expires after 30 minutes of inactivity.
sessionOptions.Cookie.HttpOnly = true; // Prevent JavaScript access to session cookie, for security.
sessionOptions.Cookie.IsEssential = true; // Mark session cookie as essential, for GDPR compliance.
});
// scan the current assembly for validators and register them as singletons in the DI container
// Scan the current assembly for validators and register them as singletons in the DI container.
foreach (Type validatorType in typeof(Program).Assembly.GetTypes())
{
if (validatorType.IsInterface || validatorType.IsAbstract || validatorType.IsGenericTypeDefinition)
@@ -273,16 +271,16 @@ public static class PresentationWebLayerServices
}
}
// handle transient errors like network timeouts or intermittent failures
// Handle transient errors like network timeouts or intermittent failures.
AsyncRetryPolicy<HttpResponseMessage> retryPolicy = Policy<HttpResponseMessage>
.Handle<HttpRequestException>()
.OrInner<ApiException>(apiException =>
apiException.HttpStatusCode != HttpStatusCode.BadRequest && // do not retry Bad Request and Forbidden responses, it's pointless
apiException.HttpStatusCode != HttpStatusCode.BadRequest && // Do not retry Bad Request and Forbidden responses, it's pointless.
apiException.HttpStatusCode != HttpStatusCode.Forbidden)
.WaitAndRetryAsync(3, retryAttempt =>
TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
// use a circuit breaker to prevent repeatedly calling a failing service
// Use a circuit breaker to prevent repeatedly calling a failing service.
AsyncCircuitBreakerPolicy<HttpResponseMessage> circuitBreakerPolicy = Policy<HttpResponseMessage>
.Handle<HttpRequestException>()
.OrInner<ApiException>(apiException => apiException.HttpStatusCode == HttpStatusCode.InternalServerError)
@@ -290,7 +288,7 @@ public static class PresentationWebLayerServices
AsyncPolicyWrap<HttpResponseMessage> policy = Policy.WrapAsync(retryPolicy, circuitBreakerPolicy);
// register the HTTP typed client used for the API interaction
// Register the HTTP typed client used for the API interaction.
services.AddHttpClient<IApiHttpClient, ApiHttpClient>()
.AddHttpMessageHandler<CachedAuthorizationHandler>()
.AddHttpMessageHandler<CachedThemeHandler>()
@@ -301,7 +299,7 @@ public static class PresentationWebLayerServices
services.AddScoped<CachedThemeHandler>();
services.AddScoped<ThemeCachePreferenceService>();
// enable access to the current HTTP context in non-controller classes
// Enable access to the current HTTP context in non-controller classes.
services.AddHttpContextAccessor();
services.Configure<FormOptions>(options => options.MultipartBodyLengthLimit = 10 * 1024 * 1024);
@@ -320,7 +318,7 @@ public static class PresentationWebLayerServices
services.AddScoped<Authorization.IAuthorizationService, AuthorizationService>();
services.AddSingleton<ICryptographyService, CryptographyService>();
services.AddSingleton<IUrlService, UrlService>();
services.AddHybridCache(); // used for caching authorization roles, permissions, policies and theme data
services.AddHybridCache(); // Used for caching authorization roles, permissions, policies and theme data.
return services;
}
@@ -16,7 +16,7 @@ using System.Diagnostics.CodeAnalysis;
namespace Lumina.Presentation.Web.Common.DependencyInjection;
/// <summary>
/// Contains the OpenTelemetry services of the Presentation Web layer.
/// Utility class for registering the OpenTelemetry services of the Presentation Web layer into the Dependency Injection container.
/// </summary>
[ExcludeFromCodeCoverage]
public static class PresentationWebTelemetryServices
@@ -24,10 +24,10 @@ public static class PresentationWebTelemetryServices
private const string SERVICE_NAME = "Lumina.Web";
/// <summary>
/// Registers the OpenTelemetry tracing and metrics pipelines into the dependency injection container.
/// Registers the OpenTelemetry services of the Presentation Web layer into the Dependency Injection container.
/// </summary>
/// <param name="services">The service collection to add the services to.</param>
/// <param name="configuration">Application configuration properties.</param>
/// <param name="configuration">The configuration used to read the application configuration.</param>
/// <param name="environment">The hosting environment of the application.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddPresentationWebTelemetryServices(this IServiceCollection services, IConfiguration configuration, IWebHostEnvironment environment)
@@ -54,8 +54,8 @@ public static class PresentationWebTelemetryServices
tracingBuilder.SetSampler(CreateSampler(traceSampleRatio));
tracingBuilder.AddSource(WebTelemetry.SOURCE_NAME);
tracingBuilder.AddAspNetCoreInstrumentation();
// the HTTP client instrumentation emits spans and metrics for the calls to the API, and injects the W3C trace context
// into their headers, so that the API continues the same trace across the two separately deployed applications
// The HTTP client instrumentation emits spans and metrics for the calls to the API, and injects the W3C trace context
// into their headers, so that the API continues the same trace across the two separately deployed applications.
tracingBuilder.AddHttpClientInstrumentation();
if (isConsoleExporterEnabled)
tracingBuilder.AddConsoleExporter();
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Path;
/// <summary>
/// Represents the request for retrieving the parent path of a file system path.
/// </summary>
/// <param name="Path">The path for which the parent path is retrieved.</param>
/// <param name="Path">The path for which the parent path is retrieved. Required.</param>
[DebuggerDisplay("Path: {Path}")]
public record GetPathParentRequest(
string? Path
@@ -7,8 +7,8 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Thumbnail
/// <summary>
/// Represents a request for retrieving the thumbnail of a file system file.
/// </summary>
/// <param name="Path">The path of the file for which the thumbnail is retrieved.</param>
/// <param name="Quality">The quality to use for the thumbnail.</param>
/// <param name="Path">The path of the file for which the thumbnail is retrieved. Required.</param>
/// <param name="Quality">The quality to use for the thumbnail. Required.</param>
[DebuggerDisplay("Path: {Path}")]
public record GetThumbnailRequest(
string? Path,
@@ -8,7 +8,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Library.Management;
/// <summary>
/// Represents the request for displaying the media library editing view.
/// </summary>
/// <param name="Id">The unique identifier of the media library to edit.</param>
/// <param name="Id">The unique identifier of the media library to edit. Required.</param>
[DebuggerDisplay("Id: {Id}")]
public record EditLibraryRequest(
Guid Id
@@ -8,7 +8,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Library.Management;
/// <summary>
/// Represents the request for retrieving the artwork providers of a media library.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library whose artwork providers are retrieved.</param>
/// <param name="LibraryId">The unique identifier of the media library whose artwork providers are retrieved. Required.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetArtworkProvidersRequest(
Guid LibraryId
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Management;
/// <summary>
/// Represents the request for retrieving the book readers of a media library.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library whose book readers are retrieved. Required.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetBookReadersRequest(
Guid LibraryId
);
@@ -8,7 +8,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Library.Management;
/// <summary>
/// Represents the request for retrieving the metadata providers of a media library.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library whose metadata providers are retrieved.</param>
/// <param name="LibraryId">The unique identifier of the media library whose metadata providers are retrieved. Required.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetMetadataProvidersRequest(
Guid LibraryId
@@ -8,7 +8,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.
/// <summary>
/// Represents a request to get a book by the specified Id.
/// </summary>
/// <param name="Id">The unique identifier of the book to retrieve.</param>
/// <param name="Id">The unique identifier of the book to retrieve. Required.</param>
[DebuggerDisplay("Id: {Id}")]
public record GetBookRequest(
Guid Id
@@ -8,7 +8,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.
/// <summary>
/// Represents the request for displaying the books browsing view.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library whose books are browsed.</param>
/// <param name="LibraryId">The unique identifier of the media library whose books are browsed. Optional.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetBooksViewRequest(
Guid? LibraryId
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to check the reading availability of a book.
/// </summary>
/// <param name="BookId">The unique identifier of the book whose reading availability is checked. Required.</param>
[DebuggerDisplay("BookId: {BookId}")]
public record GetBookReadingAvailabilityRequest(
Guid BookId
);
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get the reading manifest of a book.
/// </summary>
/// <param name="BookId">The unique identifier of the book whose reading manifest is retrieved. Required.</param>
[DebuggerDisplay("BookId: {BookId}")]
public record GetBookReadingManifestRequest(
Guid BookId
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get a resource of a book, for reading.
/// </summary>
/// <param name="BookId">The unique identifier of the book whose resource is retrieved. Required.</param>
/// <param name="ResourceKey">The opaque resource key of the resource. Required.</param>
[DebuggerDisplay("BookId: {BookId}, ResourceKey: {ResourceKey}")]
public record GetBookReadingResourceRequest(
Guid BookId,
string ResourceKey
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get the content of a reading section of a book.
/// </summary>
/// <param name="BookId">The unique identifier of the book whose reading section is retrieved. Required.</param>
/// <param name="LocationRef">The opaque location reference of the reading section. Required.</param>
[DebuggerDisplay("BookId: {BookId}, LocationRef: {LocationRef}")]
public record GetBookReadingSectionRequest(
Guid BookId,
string LocationRef
);
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents the request for displaying the reading view of a book.
/// </summary>
/// <param name="BookId">The unique identifier of the book to read. Required.</param>
[DebuggerDisplay("BookId: {BookId}")]
public record ReadBookViewRequest(
Guid BookId
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Plugins;
/// <summary>
/// Represents a request to enable or disable a book reader for a media library.
/// </summary>
[DebuggerDisplay("LibraryId: {LibraryId}, PluginId: {PluginId}")]
public class SetBookReaderEnabledRequest
{
/// <summary>
/// Gets or sets the Id of the media library whose book reader is enabled or disabled. Required.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the plugin providing the book reader. Required.
/// </summary>
public Guid PluginId { get; set; }
/// <summary>
/// Gets or sets whether the book reader should be enabled for the media library. Required.
/// </summary>
public bool IsEnabled { get; set; }
}
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to delete a theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the theme to delete.</param>
/// <param name="ThemeId">The manifest id of the theme to delete. Required.</param>
[DebuggerDisplay("ThemeId: {ThemeId}")]
public record DeleteThemeRequest(
string? ThemeId
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to download the archive of a theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the theme to download.</param>
/// <param name="ThemeId">The manifest id of the theme to download. Required.</param>
[DebuggerDisplay("ThemeId: {ThemeId}")]
public record GetThemeArchiveRequest(
string? ThemeId
@@ -7,8 +7,8 @@ namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to get an asset file of a theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the theme.</param>
/// <param name="Path">The asset path relative to the theme pack root.</param>
/// <param name="ThemeId">The manifest id of the theme. Required.</param>
/// <param name="Path">The asset path relative to the theme pack root. Required.</param>
[DebuggerDisplay("ThemeId: {ThemeId}, Path: {Path}")]
public record GetThemeAssetRequest(
string? ThemeId,
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to restore a soft deleted bundled theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the bundled theme to restore.</param>
/// <param name="ThemeId">The manifest id of the bundled theme to restore. Required.</param>
[DebuggerDisplay("ThemeId: {ThemeId}")]
public record RestoreThemeRequest(
string? ThemeId
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.Themes;
/// <summary>
/// Represents a request to set the currently active theme.
/// </summary>
/// <param name="ThemeId">The manifest id of the theme to activate.</param>
/// <param name="ThemeId">The manifest id of the theme to activate. Required.</param>
[DebuggerDisplay("ThemeId: {ThemeId}")]
public record SetCurrentThemeRequest(
string? ThemeId
@@ -7,8 +7,8 @@ namespace Lumina.Presentation.Web.Common.Requests.Tools;
/// <summary>
/// Represents the request for setting the culture used by the application.
/// </summary>
/// <param name="NewCulture">The new culture to set.</param>
/// <param name="ReturnUrl">The URL to return to, after setting the new culture.</param>
/// <param name="NewCulture">The new culture to set. Required.</param>
/// <param name="ReturnUrl">The URL to return to, after setting the new culture. Optional.</param>
[DebuggerDisplay("NewCulture: {NewCulture}, ReturnUrl: {ReturnUrl}")]
public record SetLanguageRequest(
string? NewCulture,
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Requests.UsersManagement.Authentication
/// <summary>
/// Represents the request for displaying the account login view.
/// </summary>
/// <param name="ReturnUrl">The URL to return to, after login.</param>
/// <param name="ReturnUrl">The URL to return to, after login. Optional.</param>
[DebuggerDisplay("ReturnUrl: {ReturnUrl}")]
public record LoginViewRequest(
string? ReturnUrl = null
@@ -10,7 +10,7 @@ namespace Lumina.Presentation.Web.Common.Requests.UsersManagement;
/// <param name="Username">The username of the account to authenticate. Required.</param>
/// <param name="Password">The password of the account to authenticate. Required.</param>
/// <param name="TotpCode">The TOTP (Time-Based One-Time Password) of the account to authenticate. Optional.</param>
/// <param name="ReturnUrl">The URL to return to, after login.</param>
/// <param name="ReturnUrl">The URL to return to, after login. Optional.</param>
[DebuggerDisplay("Username: {Username}")]
public record LoginRequest(
string? Username = null,
@@ -11,5 +11,9 @@ public static partial class ApiRoutes
public static class Books
{
public const string GET_BOOKS_LITE = "books/lite";
public const string GET_BOOK_READING_MANIFEST = "books/{bookId}/reading/manifest";
public const string GET_BOOK_READING_AVAILABILITY = "books/{bookId}/reading/availability";
public const string GET_BOOK_READING_SECTION = "books/{bookId}/reading/sections/{locationRef}";
public const string GET_BOOK_READING_RESOURCE = "books/{bookId}/reading/resources/{resourceKey}";
}
}
@@ -27,5 +27,7 @@ public static partial class ApiRoutes
public const string GET_LIBRARY_ARTWORK_PROVIDERS = "libraries/{libraryId}/artwork-providers";
public const string SET_LIBRARY_ARTWORK_PROVIDER_ENABLED = "libraries/{libraryId}/artwork-providers/{pluginId}/enabled";
public const string REORDER_LIBRARY_ARTWORK_PROVIDERS = "libraries/{libraryId}/artwork-providers/reorder";
public const string GET_LIBRARY_BOOK_READERS = "libraries/{libraryId}/book-readers";
public const string SET_LIBRARY_BOOK_READER_ENABLED = "libraries/{libraryId}/book-readers/{pluginId}/enabled";
}
}
@@ -13,5 +13,10 @@ public static partial class WebRoutes
public const string INDEX = "{culture}/library/written-content-library/books-library/books";
public const string GET_LIBRARY_ITEMS = "{culture}/library/written-content-library/books-library/books/api-get-library-items";
public const string EDIT_BOOK = "{culture}/library/written-content-library/books-library/books/{id}";
public const string READ = "{culture}/library/written-content-library/books-library/books/{bookId}/read";
public const string GET_READING_MANIFEST = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-manifest";
public const string GET_READING_AVAILABILITY = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-availability";
public const string GET_READING_SECTION = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-section";
public const string GET_READING_RESOURCE = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-resource";
}
}
@@ -28,5 +28,7 @@ public static partial class WebRoutes
public const string GET_ARTWORK_PROVIDERS = "{culture}/libraries/manage/api-get-artwork-providers/{libraryId}";
public const string SET_ARTWORK_PROVIDER_ENABLED = "{culture}/libraries/manage/api-set-artwork-provider-enabled";
public const string REORDER_ARTWORK_PROVIDERS = "{culture}/libraries/manage/api-reorder-artwork-providers";
public const string GET_BOOK_READERS = "{culture}/libraries/manage/api-get-book-readers/{libraryId}";
public const string SET_BOOK_READER_ENABLED = "{culture}/libraries/manage/api-set-book-reader-enabled";
}
}
@@ -22,7 +22,11 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
Summary = "Deletes a role.";
Description = "Deletes an existing authorization role identified by its unique identifier.";
RequestParam(r => r.RoleId, "The unique identifier of the role to delete.");
RequestParam(r => r.RoleId, "The unique identifier of the role to delete. Required.");
ExampleRequest = new DeleteRoleRequest(
RoleId: Guid.NewGuid()
);
Response(200, "The role is deleted.", example: new SuccessResponse(true));
}
@@ -23,7 +23,11 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
Summary = "Gets the permissions of a role.";
Description = "Retrieves the permissions of an existing authorization role identified by its unique identifier.";
RequestParam(r => r.RoleId, "The unique identifier of the role whose permissions are retrieved.");
RequestParam(r => r.RoleId, "The unique identifier of the role whose permissions are retrieved. Required.");
ExampleRequest = new GetRolePermissionsRequest(
RoleId: Guid.NewGuid()
);
Response(200, "The permissions of the role are returned.", example: new SuccessResponse<RolePermissionsDto>(true, default));
}
@@ -22,7 +22,11 @@ public class DeleteThemeEndpointSummary : Summary<DeleteThemeEndpoint, DeleteThe
Summary = "Deletes a theme.";
Description = "Deletes the theme identified by the request, switching to another available theme when the deleted theme was the active one.";
RequestParam(r => r.ThemeId, "The manifest id of the theme to delete.");
RequestParam(r => r.ThemeId, "The manifest id of the theme to delete. Required.");
ExampleRequest = new DeleteThemeRequest(
ThemeId: "neon-grid"
);
Response(200, "The theme was successfully deleted.", example: new SuccessResponse(true));
}
@@ -21,7 +21,11 @@ public class DownloadThemeEndpointSummary : Summary<DownloadThemeEndpoint, GetTh
Summary = "Downloads the archive of a theme.";
Description = "Downloads the ZIP archive of the installed theme identified by the request.";
RequestParam(r => r.ThemeId, "The manifest id of the theme to download.");
RequestParam(r => r.ThemeId, "The manifest id of the theme to download. Required.");
ExampleRequest = new GetThemeArchiveRequest(
ThemeId: "lumina-default"
);
Response(200, "The ZIP archive of the theme is returned.", "application/zip");
}
@@ -22,7 +22,11 @@ public class SetCurrentThemeEndpointSummary : Summary<SetCurrentThemeEndpoint, S
Summary = "Sets the currently active theme.";
Description = "Sets the theme identified by the request as the currently active theme.";
RequestParam(r => r.ThemeId, "The manifest id of the theme to activate.");
RequestParam(r => r.ThemeId, "The manifest id of the theme to activate. Required.");
ExampleRequest = new SetCurrentThemeRequest(
ThemeId: "lumina-default"
);
Response(200, "The theme was successfully activated.", example: new SuccessResponse(true));
}
@@ -23,7 +23,11 @@ public class GetUserPermissionsEndpointSummary : Summary<GetUserPermissionsEndpo
Summary = "Gets the permissions of a user.";
Description = "Retrieves the authorization permissions of a user identified by its unique identifier.";
RequestParam(r => r.UserId, "The unique identifier of the user for whom to get the authorization permissions.");
RequestParam(r => r.UserId, "The unique identifier of the user for whom to get the authorization permissions. Required.");
ExampleRequest = new GetUserPermissionsRequest(
UserId: Guid.NewGuid()
);
Response(200, "The permissions of the user are returned.", example: new SuccessResponse<PermissionDto[]>(true, default));
}
@@ -23,7 +23,11 @@ public class GetUserRoleEndpointSummary : Summary<GetUserRoleEndpoint, GetUserRo
Summary = "Gets the role of a user.";
Description = "Retrieves the authorization role of a user identified by its unique identifier.";
RequestParam(r => r.UserId, "The unique identifier of the user for whom to get the authorization role.");
RequestParam(r => r.UserId, "The unique identifier of the user for whom to get the authorization role. Required.");
ExampleRequest = new GetUserRoleRequest(
UserId: Guid.NewGuid()
);
Response(200, "The role of the user is returned.", example: new SuccessResponse<RoleDto?>(true, default));
}
@@ -23,8 +23,13 @@ public class GetDirectoriesEndpointSummary : Summary<GetDirectoriesEndpoint, Get
Summary = "Retrieves the directories of a file system path.";
Description = "Retrieves the directories of the file system path identified by the request.";
RequestParam(r => r.Path, "The file system path for which to get the directories.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not.");
RequestParam(r => r.Path, "The file system path for which to get the directories. Required.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
ExampleRequest = new GetDirectoriesRequest(
Path: "/media/movies/",
IncludeHiddenElements: true
);
Response(200, "The directories of the file system path are returned.", example: new SuccessResponse<DirectoryDto[]>(true, default));
}
@@ -23,8 +23,13 @@ public class GetFilesEndpointSummary : Summary<GetFilesEndpoint, GetFilesRequest
Summary = "Retrieves the files of a file system path.";
Description = "Retrieves the files of the file system path identified by the request.";
RequestParam(r => r.Path, "The file system path for which to get the files.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not.");
RequestParam(r => r.Path, "The file system path for which to get the files. Required.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
ExampleRequest = new GetFilesRequest(
Path: "/media/movies/",
IncludeHiddenElements: true
);
Response(200, "The files of the file system path are returned.", example: new SuccessResponse<FileDto[]>(true, default));
}
@@ -23,8 +23,13 @@ public class GetTreeFilesEndpointSummary : Summary<GetTreeFilesEndpoint, GetTree
Summary = "Retrieves the file system tree of a file system path.";
Description = "Retrieves the file system tree of the file system path identified by the request.";
RequestParam(r => r.Path, "The file system path for which to get the tree files.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not.");
RequestParam(r => r.Path, "The file system path for which to get the tree files. Required.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
ExampleRequest = new GetTreeFilesRequest(
Path: "/media/movies/",
IncludeHiddenElements: true
);
Response(200, "The file system tree of the file system path is returned.", example: new SuccessResponse<FileSystemTreeNodeDto[]>(true, default));
}
@@ -21,8 +21,13 @@ public class CheckPathExistsEndpointSummary : Summary<CheckPathExistsEndpoint, C
Summary = "Checks the existence of a file system path.";
Description = "Checks whether the file system path identified by the request exists.";
RequestParam(r => r.Path, "The file system path to check the existence of.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden elements in the search results, or not.");
RequestParam(r => r.Path, "The file system path to check the existence of. Required.");
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden elements in the search results, or not. Optional.");
ExampleRequest = new CheckPathExistsRequest(
Path: "/media/movies/",
IncludeHiddenElements: true
);
Response(200, "Whether the file system path exists is returned.", example: new { success = true, data = new { exists = true } });
}
@@ -22,8 +22,12 @@ public class GetPathParentEndpointSummary : Summary<GetPathParentEndpoint, GetPa
Summary = "Retrieves the parent path of a file system path.";
Description = "Retrieves the path segments of the parent path of the file system path identified by the request.";
RequestParam(r => r.Path, "The path for which the parent path is retrieved.");
RequestParam(r => r.Path, "The path for which the parent path is retrieved. Required.");
Response(200, "The path segments of the parent path are returned.", example: new { success = true, data = new { pathSegments = new PathSegmentDto[] { } } });
ExampleRequest = new GetPathParentRequest(
Path: "/media/movies/"
);
Response(200, "The path segments of the parent path are returned.", example: new { success = true, data = new { pathSegments = Array.Empty<PathSegmentDto>() } });
}
}
@@ -22,7 +22,11 @@ public class GetPathRootEndpointSummary : Summary<GetPathRootEndpoint, GetPathRo
Summary = "Retrieves the root of a file system path.";
Description = "Retrieves the root of the file system path identified by the request.";
RequestParam(r => r.Path, "The file system path for which to get the root.");
RequestParam(r => r.Path, "The file system path for which to get the root. Required.");
ExampleRequest = new GetPathRootRequest(
Path: "/media/movies/"
);
Response(200, "The root of the file system path is returned.", example: new { success = true, data = new { root = new PathSegmentDto() } });
}
@@ -22,8 +22,12 @@ public class SplitPathEndpointSummary : Summary<SplitPathEndpoint, SplitPathRequ
Summary = "Splits a file system path into its segments.";
Description = "Splits the file system path identified by the request into its path segments.";
RequestParam(r => r.Path, "The file system path for which to get the path segments.");
RequestParam(r => r.Path, "The file system path for which to get the path segments. Required.");
Response(200, "The path segments of the file system path are returned.", example: new { success = true, data = new { pathSegments = new PathSegmentDto[] { } } });
ExampleRequest = new SplitPathRequest(
Path: "/media/movies/"
);
Response(200, "The path segments of the file system path are returned.", example: new { success = true, data = new { pathSegments = Array.Empty<PathSegmentDto>() } });
}
}
@@ -21,7 +21,11 @@ public class ValidatePathEndpointSummary : Summary<ValidatePathEndpoint, Validat
Summary = "Validates a file system path.";
Description = "Validates the file system path identified by the request.";
RequestParam(r => r.Path, "The file system path to validate.");
RequestParam(r => r.Path, "The file system path to validate. Required.");
ExampleRequest = new ValidatePathRequest(
Path: "/media/movies/"
);
Response(200, "Whether the file system path is valid is returned.", example: new { success = true, data = new { isValid = true } });
}
@@ -22,8 +22,13 @@ public class CancelLibraryScanEndpointSummary : Summary<CancelLibraryScanEndpoin
Summary = "Cancels the scan of a media library.";
Description = "Cancels a running scan of the media library identified by the request.";
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose scan is cancelled.");
RequestParam(r => r.ScanId, "The Id of the scan to cancel.");
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose scan is cancelled. Required.");
RequestParam(r => r.ScanId, "The Id of the scan to cancel. Required.");
ExampleRequest = new CancelLibraryScanRequest(
LibraryId: Guid.NewGuid(),
ScanId: Guid.NewGuid()
);
Response(200, "The scan of the media library is cancelled.", example: new SuccessResponse(true));
}
@@ -22,7 +22,11 @@ public class DeleteLibraryEndpointSummary : Summary<DeleteLibraryEndpoint, Delet
Summary = "Deletes a media library.";
Description = "Deletes the media library identified by the request.";
RequestParam(r => r.Id, "The unique identifier of the media library to delete.");
RequestParam(r => r.Id, "The unique identifier of the media library to delete. Required.");
ExampleRequest = new DeleteLibraryRequest(
Id: Guid.NewGuid()
);
Response(200, "The media library is deleted.", example: new SuccessResponse(true));
}
@@ -21,7 +21,11 @@ public class EditLibraryViewEndpointSummary : Summary<EditLibraryViewEndpoint, E
Summary = "Renders the edit library view.";
Description = "Renders the view for editing the media library identified by the request.";
RequestParam(r => r.Id, "The unique identifier of the media library to edit.");
RequestParam(r => r.Id, "The unique identifier of the media library to edit. Required.");
ExampleRequest = new EditLibraryRequest(
Id: Guid.NewGuid()
);
Response(200, "The view for editing the media library is rendered.");
}
@@ -23,7 +23,11 @@ public class GetArtworkProvidersEndpointSummary : Summary<GetArtworkProvidersEnd
Summary = "Retrieves the artwork providers of a media library.";
Description = "Retrieves the artwork providers of the media library identified by the request.";
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose artwork providers are retrieved.");
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose artwork providers are retrieved. Required.");
ExampleRequest = new GetArtworkProvidersRequest(
LibraryId: Guid.NewGuid()
);
Response(200, "The artwork providers of the media library are returned.", example: new SuccessResponse<LibraryArtworkProviderDto[]>(true, default));
}
@@ -0,0 +1,54 @@
#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.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetBookReaders;
/// <summary>
/// API endpoint for the <c>/{culture}/libraries/manage/api-get-book-readers/{libraryId}</c> route.
/// </summary>
public class GetBookReadersEndpoint : BaseEndpoint<GetBookReadersRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetBookReadersEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetBookReadersEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryManagement.GET_BOOK_READERS);
DontAutoTag();
Options(options => options.WithTags("Libraries"));
}
/// <summary>
/// Retrieves the book readers of a media library.
/// </summary>
/// <param name="request">The request containing the Id of the media library whose 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(GetBookReadersRequest request, CancellationToken cancellationToken)
{
LibraryBookReaderDto[] response = await _apiHttpClient.GetAsync<LibraryBookReaderDto[]>(ApiRoutes.Libraries.GET_LIBRARY_BOOK_READERS.Replace("{libraryId}", request.LibraryId.ToString()), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
}
@@ -0,0 +1,31 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.Management;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Management.GetBookReaders;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetBookReadersEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetBookReadersEndpointSummary : Summary<GetBookReadersEndpoint, GetBookReadersRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetBookReadersEndpointSummary"/> class.
/// </summary>
public GetBookReadersEndpointSummary()
{
Summary = "Retrieves the book readers of a media library.";
Description = "Retrieves the book readers of the media library identified by the request, with their supported file extensions and enabled state.";
RequestParam(r => r.LibraryId, "The Id of the media library whose book readers are retrieved. Required.");
ExampleRequest = new GetBookReadersRequest(
LibraryId: Guid.NewGuid()
);
Response(200, "The book readers of the media library are returned.");
}
}
@@ -23,7 +23,11 @@ public class GetMetadataProvidersEndpointSummary : Summary<GetMetadataProvidersE
Summary = "Retrieves the metadata providers of a media library.";
Description = "Retrieves the metadata providers of the media library identified by the request.";
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose metadata providers are retrieved.");
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose metadata providers are retrieved. Required.");
ExampleRequest = new GetMetadataProvidersRequest(
LibraryId: Guid.NewGuid()
);
Response(200, "The metadata providers of the media library are returned.", example: new SuccessResponse<LibraryMetadataProviderDto[]>(true, default));
}
@@ -23,7 +23,11 @@ public class ScanLibraryEndpointSummary : Summary<ScanLibraryEndpoint, ScanLibra
Summary = "Starts the scan of a media library.";
Description = "Initiates the scan of the media library identified by the request.";
RequestParam(r => r.Id, "The unique identifier of the media library to scan.");
RequestParam(r => r.Id, "The unique identifier of the media library to scan. Required.");
ExampleRequest = new ScanLibraryRequest(
Id: Guid.NewGuid()
);
Response(200, "The scan of the media library is started.", example: new SuccessResponse<ScanLibraryDto>(true, default));
}
@@ -0,0 +1,54 @@
#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();
}
}
@@ -0,0 +1,37 @@
#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 request.";
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));
}
}
@@ -21,7 +21,11 @@ public class EditBookViewEndpointSummary : Summary<EditBookViewEndpoint, GetBook
Summary = "Renders the edit book view.";
Description = "Renders the view for editing the book identified by the request.";
RequestParam(r => r.Id, "The unique identifier of the book to edit.");
RequestParam(r => r.Id, "The unique identifier of the book to edit. Required.");
ExampleRequest = new GetBookRequest(
Id: Guid.NewGuid()
);
Response(200, "The view for editing the book is rendered.");
}
@@ -2,7 +2,9 @@
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.Libraries;
using Lumina.Presentation.Web.Common.Enums.Common;
using Lumina.Presentation.Web.Common.Requests.Libraries;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -22,14 +24,26 @@ public class GetLibraryItemsEndpointSummary : Summary<GetLibraryItemsEndpoint, G
Summary = "Retrieves the lightweight details of the books of a media library.";
Description = "Retrieves the lightweight details of the books of the media library identified by the request.";
RequestParam(r => r.LibraryId, "The Id of the media library whose books are retrieved.");
RequestParam(r => r.CurrentPage, "Optional. The page of results to retrieve.");
RequestParam(r => r.PerPage, "Optional. The maximum number of books to retrieve per page.");
RequestParam(r => r.SearchTerm, "Optional. The search term used to filter results.");
RequestParam(r => r.FilterAlphaKey, "Optional. The alpha key used to filter the results by the first character of their title, for the alpha picker.");
RequestParam(r => r.ShouldIgnoreThePrefixForAlphaPicker, "Whether the leading The prefix of a title is ignored when computing the alpha key, or not.");
RequestParam(r => r.SortBy, "Optional. The name of the field by which to sort the results.");
RequestParam(r => r.SortOrder, "Optional. The direction in which to sort the results.");
RequestParam(r => r.LibraryId, "The Id of the media library whose books are retrieved. Required.");
RequestParam(r => r.CurrentPage, "The page of results to retrieve. Optional.");
RequestParam(r => r.PerPage, "The maximum number of books to retrieve per page. Optional.");
RequestParam(r => r.SearchTerm, "The search term used to filter results. Optional.");
RequestParam(r => r.FilterAlphaKey, "The alpha key used to filter the results by the first character of their title, for the alpha picker. Optional.");
RequestParam(r => r.ShouldIgnoreThePrefixForAlphaPicker, "Whether the leading The prefix of a title is ignored when computing the alpha key, or not. Optional.");
RequestParam(r => r.SortBy, "The name of the field by which to sort the results. Optional.");
RequestParam(r => r.SortOrder, "The direction in which to sort the results. Optional.");
ExampleRequest = new GetBooksLiteRequest
{
LibraryId = Guid.NewGuid(),
CurrentPage = 1,
PerPage = 48,
SearchTerm = "fellowship",
FilterAlphaKey = "f",
ShouldIgnoreThePrefixForAlphaPicker = true,
SortBy = "title",
SortOrder = SortOrder.Ascending
};
Response(200, "The lightweight details of the books of the media library are returned.", example: new SuccessResponse<PaginatedBookLiteDto>(true, default));
}
@@ -12,6 +12,7 @@ using Lumina.Presentation.Web.Core.Themes;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -85,6 +86,8 @@ public class BooksIndexViewEndpoint : BaseEndpoint<GetBooksViewRequest, IResult>
["libraryId"] = library.Id?.ToString() ?? request.LibraryId.Value.ToString(),
["itemsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.GET_LIBRARY_ITEMS) ?? string.Empty,
["settingsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_USER_SETTINGS) ?? string.Empty,
["readUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.READ, new { bookId = default(Guid) }) ?? string.Empty,
["availabilityUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.GET_READING_AVAILABILITY, new { bookId = default(Guid) }) ?? string.Empty,
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer)
}
};
@@ -21,7 +21,11 @@ public class BooksIndexViewEndpointSummary : Summary<BooksIndexViewEndpoint, Get
Summary = "Renders the books browsing view.";
Description = "Renders the view for browsing the books of the media library identified by the request.";
RequestParam(r => r.LibraryId, "Optional. The unique identifier of the media library whose books are browsed.");
RequestParam(r => r.LibraryId, "The unique identifier of the media library whose books are browsed. Optional.");
ExampleRequest = new GetBooksViewRequest(
LibraryId: Guid.NewGuid()
);
Response(200, "The view for browsing the books of the media library is rendered.");
}
@@ -0,0 +1,54 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Reading;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
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.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingAvailability;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-availability</c> route.
/// </summary>
public class GetReadingAvailabilityEndpoint : BaseEndpoint<GetBookReadingAvailabilityRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingAvailabilityEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetReadingAvailabilityEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.GET_READING_AVAILABILITY);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Checks the reading availability of a book.
/// </summary>
/// <param name="request">The request containing the Id of the book whose reading availability is checked.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookReadingAvailabilityRequest request, CancellationToken cancellationToken)
{
ReadingAvailabilityDto response = await _apiHttpClient.GetAsync<ReadingAvailabilityDto>(ApiRoutes.Books.GET_BOOK_READING_AVAILABILITY.Replace("{bookId}", request.BookId.ToString()), cancellationToken).ConfigureAwait(false);
return Results.Json(new { success = response.IsAvailable, errorCode = response.ErrorCode, libraryId = response.LibraryId });
}
}
@@ -0,0 +1,37 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingAvailability;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetReadingAvailabilityEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetReadingAvailabilityEndpointSummary : Summary<GetReadingAvailabilityEndpoint, GetBookReadingAvailabilityRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingAvailabilityEndpointSummary"/> class.
/// </summary>
public GetReadingAvailabilityEndpointSummary()
{
Summary = "Checks the reading availability of a book.";
Description = "Checks whether the book can be opened for reading, resolving the book reader configured for its media library and verifying that the reader is enabled, without extracting the book.";
RequestParam(r => r.BookId, "The Id of the book whose reading availability is checked. Required.");
ExampleRequest = new GetBookReadingAvailabilityRequest(
BookId: Guid.NewGuid()
);
Response(200, "The reading availability of the book is returned.",
example: new
{
success = false,
errorCode = "ReaderDisabled",
libraryId = Guid.NewGuid()
});
}
}
@@ -0,0 +1,68 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Reading;
using Lumina.Presentation.Web.Common.Exceptions;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
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.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingManifest;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-manifest</c> route.
/// </summary>
public class GetReadingManifestEndpoint : BaseEndpoint<GetBookReadingManifestRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingManifestEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetReadingManifestEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.GET_READING_MANIFEST);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Retrieves the reading manifest of a book.
/// </summary>
/// <param name="request">The request containing the Id of the book whose reading manifest is retrieved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookReadingManifestRequest request, CancellationToken cancellationToken)
{
try
{
ReadingManifestDto response = await _apiHttpClient.GetAsync<ReadingManifestDto>(ApiRoutes.Books.GET_BOOK_READING_MANIFEST.Replace("{bookId}", request.BookId.ToString()), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
catch (ApiException apiException)
{
// When the book has no available reader or its reader is disabled, the manifest cannot be produced at all; the reader view
// distinguishes this case from a generic failure and warns the user, so it is reported with a distinct error code instead of
// being flattened to a generic "NotFound" by the exception handling middleware.
if (apiException.ProblemDetails?.Detail is "NoReaderAvailable" or "ReaderDisabled")
return Results.Json(new { success = false, errorCode = apiException.ProblemDetails.Detail });
throw;
}
}
}
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingManifest;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetReadingManifestEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetReadingManifestEndpointSummary : Summary<GetReadingManifestEndpoint, GetBookReadingManifestRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingManifestEndpointSummary"/> class.
/// </summary>
public GetReadingManifestEndpointSummary()
{
Summary = "Retrieves the reading manifest of a book.";
Description = "Retrieves the reading manifest of a book, containing the metadata, the table of contents, the spine, and the resources needed to render the reader.";
RequestParam(r => r.BookId, "The Id of the book whose reading manifest is retrieved. Required.");
ExampleRequest = new GetBookReadingManifestRequest(
BookId: Guid.NewGuid()
);
Response(200, "The reading manifest of the book is returned.");
Response(200, "The book cannot be read because no book reader is available for its format, or its book reader is disabled for the library.", "application/json",
example: new
{
success = false,
errorCode = "ReaderDisabled"
});
}
}
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
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.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingResource;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-resource</c> route.
/// </summary>
public class GetReadingResourceEndpoint : BaseEndpoint<GetBookReadingResourceRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingResourceEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetReadingResourceEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.GET_READING_RESOURCE);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Retrieves a resource of a book, for reading.
/// </summary>
/// <param name="request">The request containing the Id of the book and the resource key of the resource.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookReadingResourceRequest request, CancellationToken cancellationToken)
{
BlobDataDto response = await _apiHttpClient.GetBlobAsync(ApiRoutes.Books.GET_BOOK_READING_RESOURCE
.Replace("{bookId}", request.BookId.ToString())
.Replace("{resourceKey}", Uri.EscapeDataString(request.ResourceKey)), cancellationToken).ConfigureAwait(false);
// The resource is served without content sniffing, so that the browser never renders book content as anything but the media type the API declared.
HttpContext.Response.Headers["X-Content-Type-Options"] = "nosniff";
return Results.Bytes(response.Data, response.ContentType);
}
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingResource;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetReadingResourceEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetReadingResourceEndpointSummary : Summary<GetReadingResourceEndpoint, GetBookReadingResourceRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingResourceEndpointSummary"/> class.
/// </summary>
public GetReadingResourceEndpointSummary()
{
Summary = "Retrieves a resource of a book, for reading.";
Description = "Retrieves the binary content of a resource of a book, such as an image or a font referenced by a reading section.";
RequestParam(r => r.BookId, "The Id of the book whose resource is retrieved. Required.");
RequestParam(r => r.ResourceKey, "The opaque resource key of the resource. Required.");
ExampleRequest = new GetBookReadingResourceRequest(
BookId: Guid.NewGuid(),
ResourceKey: "cover-image"
);
Response(200, "The resource of the book is returned.");
}
}
@@ -0,0 +1,57 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Reading;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
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.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingSection;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-section</c> route.
/// </summary>
public class GetReadingSectionEndpoint : BaseEndpoint<GetBookReadingSectionRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingSectionEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetReadingSectionEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.GET_READING_SECTION);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Retrieves the content of a reading section of a book.
/// </summary>
/// <param name="request">The request containing the Id of the book and the location reference of the reading section.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookReadingSectionRequest request, CancellationToken cancellationToken)
{
ReadingSectionDto response = await _apiHttpClient.GetAsync<ReadingSectionDto>(ApiRoutes.Books.GET_BOOK_READING_SECTION
.Replace("{bookId}", request.BookId.ToString())
.Replace("{locationRef}", Uri.EscapeDataString(request.LocationRef)), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.Reading.GetReadingSection;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetReadingSectionEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetReadingSectionEndpointSummary : Summary<GetReadingSectionEndpoint, GetBookReadingSectionRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetReadingSectionEndpointSummary"/> class.
/// </summary>
public GetReadingSectionEndpointSummary()
{
Summary = "Retrieves the content of a reading section of a book.";
Description = "Retrieves the sanitized HTML content of the reading section of a book, ready to be rendered by the client.";
RequestParam(r => r.BookId, "The Id of the book whose reading section is retrieved. Required.");
RequestParam(r => r.LocationRef, "The opaque location reference of the reading section. Required.");
ExampleRequest = new GetBookReadingSectionRequest(
BookId: Guid.NewGuid(),
LocationRef: "chapter-1"
);
Response(200, "The content of the reading section is returned.");
}
}
@@ -0,0 +1,40 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
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.WrittenContentLibrary.BookLibrary.Books.Reading.Read;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/read</c> route.
/// </summary>
public class ReadViewEndpoint : BaseEndpoint<ReadBookViewRequest, IResult>
{
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.READ);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Displays the reading view of a book.
/// </summary>
/// <param name="request">The request containing the Id of the book to read.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override Task<IResult> ExecuteAsync(ReadBookViewRequest request, CancellationToken cancellationToken)
{
return Task.FromResult(View("/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Read.cshtml", request));
}
}
@@ -0,0 +1,31 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books.Reading;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.Reading.Read;
/// <summary>
/// Class used for providing a textual description for the <see cref="ReadViewEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class ReadViewEndpointSummary : Summary<ReadViewEndpoint, ReadBookViewRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="ReadViewEndpointSummary"/> class.
/// </summary>
public ReadViewEndpointSummary()
{
Summary = "Displays the reading view of a book.";
Description = "Displays the reading view of the book identified by the request.";
RequestParam(r => r.BookId, "The Id of the book to read. Required.");
ExampleRequest = new ReadBookViewRequest(
BookId: Guid.NewGuid()
);
Response(200, "The reading view of the book is displayed.");
}
}
@@ -23,7 +23,11 @@ public class GetPluginSettingsEndpointSummary : Summary<GetPluginSettingsEndpoin
Summary = "Retrieves the settings of a plugin and their schema.";
Description = "Retrieves the settings and their schema of the plugin identified by the request.";
RequestParam(r => r.PluginId, "The unique identifier of the plugin whose settings are retrieved.");
RequestParam(r => r.PluginId, "The unique identifier of the plugin whose settings are retrieved. Required.");
ExampleRequest = new GetPluginSettingsRequest(
PluginId: Guid.NewGuid()
);
Response(200, "The settings and their schema of the plugin are returned.", example: new SuccessResponse<PluginSettingsDto>(true, default));
}
@@ -21,8 +21,13 @@ public class ThemeAssetsEndpointSummary : Summary<ThemeAssetsEndpoint, GetThemeA
Summary = "Retrieves an asset file of a theme.";
Description = "Serves the binary content of an asset file of a theme, fetched from the remote API.";
RequestParam(r => r.ThemeId, "The manifest id of the theme.");
RequestParam(r => r.Path, "The asset path relative to the theme pack root.");
RequestParam(r => r.ThemeId, "The manifest id of the theme. Required.");
RequestParam(r => r.Path, "The asset path relative to the theme pack root. Required.");
ExampleRequest = new GetThemeAssetRequest(
ThemeId: "lumina-default",
Path: "assets/style.css"
);
Response(200, "The asset file of the theme is returned.", "application/octet-stream");
}
@@ -21,8 +21,13 @@ public class SetLanguageEndpointSummary : Summary<SetLanguageEndpoint, SetLangua
Summary = "Sets the culture of the application.";
Description = "Sets the culture used by the application, storing the preference in a cookie, and redirects the browser back.";
RequestParam(r => r.NewCulture, "The new culture to set.");
RequestParam(r => r.ReturnUrl, "The URL to return to, after setting the new culture.");
RequestParam(r => r.NewCulture, "The new culture to set. Required.");
RequestParam(r => r.ReturnUrl, "The URL to return to, after setting the new culture. Optional.");
ExampleRequest = new SetLanguageRequest(
NewCulture: "en-US",
ReturnUrl: "/"
);
Response(200, "The culture preference is stored in a cookie, and the browser is redirected back.");
}
@@ -21,7 +21,11 @@ public class LoginViewEndpointSummary : Summary<LoginViewEndpoint, LoginViewRequ
Summary = "Renders the account login view.";
Description = "Renders the account login view, using the specified URL to return to after login.";
RequestParam(r => r.ReturnUrl, "The URL to return to, after login.");
RequestParam(r => r.ReturnUrl, "The URL to return to, after login. Optional.");
ExampleRequest = new LoginViewRequest(
ReturnUrl: "/"
);
Response(200, "The account login view is rendered.");
}
@@ -337,9 +337,18 @@
<value>مزوّدو البيانات الوصفية المستخدمون لإثراء عناصر هذه المكتبة، بالترتيب الذي يتم تجريبهم به.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>مزوّدو الأغلفة</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>مزوّدو الأغلفة المستخدمون لاسترداد أغلفة عناصر هذه المكتبة، بالترتيب الذي يتم تجريبهم به.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>قارئات الكتب</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>الامتدادات المدعومة</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>قارئات الكتب المستخدمة لقراءة كتب هذه المكتبة. القارئة المعطّلة تتيح للمستخدم معرفة أن هناك إضافة قارئ لهذا التنسيق، لكنها معطّلة.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>Die Metadatenanbieter, die verwendet werden, um die Elemente dieser Bibliothek anzureichern, in der Reihenfolge, in der sie versucht werden.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Cover-Anbieter</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>Die Cover-Anbieter, die zum Abrufen der Cover der Elemente dieser Bibliothek verwendet werden, in der Reihenfolge, in der sie ausprobiert werden.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Buchleser</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Unterstützte Erweiterungen</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>Die Buchleser, die zum Lesen der Bücher dieser Bibliothek verwendet werden. Ein deaktivierter Buchleser informiert den Benutzer darüber, dass ein Leser-Plugin für das Format existiert, es aber deaktiviert ist.</value>
</data>
</root>
@@ -342,4 +342,13 @@
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Book readers</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Supported extensions</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>The book readers used to read the books of this library. A disabled book reader lets the user know that a reader plugin exists for the format, but it is disabled.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>Los proveedores de metadatos utilizados para enriquecer los elementos de esta biblioteca, en el orden en que se prueban.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Proveedores de portadas</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>Los proveedores de portadas utilizados para recuperar las portadas de los elementos de esta biblioteca, en el orden en que se prueban.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Lectores de libros</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Extensiones compatibles</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>Los lectores de libros utilizados para leer los libros de esta biblioteca. Un lector deshabilitado le indica al usuario que existe un complemento de lectura para el formato, pero que está deshabilitado.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<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>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Fournisseurs de couvertures</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>Les fournisseurs de couvertures utilisés pour récupérer les couvertures des éléments de cette bibliothèque, dans l'ordre où ils sont essayés.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Lecteurs de livres</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Extensions prises en charge</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>Les lecteurs de livres utilisés pour lire les livres de cette bibliothèque. Un lecteur désactivé indique à l'utilisateur qu'un plugin de lecture existe pour le format, mais qu'il est désactivé.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>I fornitori di metadati utilizzati per arricchire gli elementi di questa libreria, nell'ordine in cui vengono provati.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Fornitori di copertine</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>I fornitori di copertine utilizzati per recuperare le copertine degli elementi di questa libreria, nell'ordine in cui vengono provati.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Lettori di libri</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Estensioni supportate</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>I lettori di libri utilizzati per leggere i libri di questa libreria. Un lettore disabilitato informa l'utente che esiste un plugin di lettura per il formato, ma che è disabilitato.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>このライブラリのアイテムを補完するために使用されるメタデータプロバイダーを、試行する順序で指定します。</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>表紙プロバイダー</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>このライブラリのアイテムの表紙を取得するために使用される表紙プロバイダーを、試行する順序で指定します。</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>書籍リーダー</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>対応する拡張子</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>このライブラリの書籍を読むために使用されるリーダーです。無効なリーダーは、その形式のリーダープラグインが存在するが無効になっていることをユーザーに知らせます。</value>
</data>
</root>
@@ -342,4 +342,13 @@
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Book readers</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Supported extensions</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>The book readers used to read the books of this library. A disabled book reader lets the user know that a reader plugin exists for the format, but it is disabled.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>Furnizorii de metadate folosiți pentru a îmbogăți elementele acestei biblioteci, în ordinea în care sunt încercați.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Furnizori de coperți</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>Furnizorii de coperți folosiți pentru a recupera coperțile elementelor acestei biblioteci, în ordinea în care sunt încercați.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Cititori de cărți</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Extensii acceptate</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>Cititorii de cărți folosiți pentru a citi cărțile acestei biblioteci. Un cititor dezactivat îi permite utilizatorului să știe că există un plugin de citire pentru format, dar este dezactivat.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>Постачальники метаданих, які використовуються для збагачення елементів цієї бібліотеки, у порядку, в якому вони випробовуються.</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>Постачальники обкладинок</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>Постачальники обкладинок, які використовуються для отримання обкладинок елементів цієї бібліотеки, у порядку, в якому вони випробовуються.</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>Читачі книг</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>Підтримувані розширення</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>Читачі книг, які використовуються для читання книг цієї бібліотеки. Вимкнений читач повідомляє користувача про те, що для цього формату існує плагін для читання, але він вимкнений.</value>
</data>
</root>
@@ -337,9 +337,18 @@
<value>用于丰富此库项目内容的元数据提供程序,按其尝试顺序排列。</value>
</data>
<data name="ArtworkProviders" xml:space="preserve">
<value>Artwork providers</value>
<value>封面提供程序</value>
</data>
<data name="DescriptionArtworkProviders" xml:space="preserve">
<value>The artwork providers used to retrieve the covers of the items of this library, in the order they are tried.</value>
<value>用于获取此库项目封面的封面提供程序,按其尝试顺序排列。</value>
</data>
<data name="BookReaders" xml:space="preserve">
<value>书籍阅读器</value>
</data>
<data name="SupportedExtensions" xml:space="preserve">
<value>支持的扩展名</value>
</data>
<data name="DescriptionBookReaders" xml:space="preserve">
<value>用于阅读此库书籍的阅读器。禁用的阅读器会让用户知道该格式存在阅读器插件,但该插件已被禁用。</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>لا توجد عناصر تطابق الفلاتر الحالية</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>لا يوجد قارئ كتب متاح يمكنه فتح هذا التنسيق من الكتب.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>قارئ الكتب الذي يفتح هذا الكتاب معطل لهذه المكتبة. قم بتمكينه في إعدادات المكتبة لقراءة الكتاب.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Keine Einträge entsprechen den aktuellen Filtern</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>Es ist kein Buchleser verfügbar, der dieses Buchformat öffnen kann.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>Der Buchleser, der dieses Buch öffnet, ist für diese Mediathek deaktiviert. Aktivieren Sie ihn in den Mediathek-Einstellungen, um das Buch zu lesen.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>No items match the current filters</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>There is no book reader available that can open this book format.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>The book reader that opens this book is disabled for this library. Enable it in the library settings to read the book.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Ningún elemento coincide con los filtros actuales</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>No hay ningún lector de libros disponible que pueda abrir este formato de libro.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>El lector de libros que abre este libro está deshabilitado para esta biblioteca. Habilítelo en la configuración de la biblioteca para leer el libro.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Aucun élément ne correspond aux filtres actuels</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>Aucun lecteur de livres n&apos;est disponible pour ouvrir ce format de livre.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>Le lecteur de livres qui ouvre ce livre est désactivé pour cette bibliothèque. Activez-le dans les paramètres de la bibliothèque pour lire le livre.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Nessun elemento corrisponde ai filtri correnti</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>Non è disponibile nessun lettore di libri in grado di aprire questo formato di libro.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>Il lettore di libri che apre questo libro è disabilitato per questa biblioteca. Abilitalo nelle impostazioni della biblioteca per leggere il libro.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>現在のフィルターに一致する項目はありません</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>この本の形式を開けるブックリーダーがありません。</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>この本を開くブックリーダーは、このライブラリで無効になっています。ライブラリ設定で有効にすると本を読めます。</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>No items match the current filters</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>There is no book reader available that can open this book format.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>The book reader that opens this book is disabled for this library. Enable it in the library settings to read the book.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Niciun element nu corespunde filtrelor curente</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>Nu există niciun cititor de cărți disponibil care să poată deschide acest format de carte.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>Cititorul de cărți care deschide această carte este dezactivat pentru această bibliotecă. Activați-l în setările bibliotecii pentru a citi cartea.</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>Жоден елемент не відповідає поточним фільтрам</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>Немає доступного читача книг, який міг би відкрити цей формат книги.</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>Читач книг, який відкриває цю книгу, вимкнено для цієї бібліотеки. Увімкніть його в налаштуваннях бібліотеки, щоб читати книгу.</value>
</data>
</root>
@@ -45,4 +45,10 @@
<data name="NoItemsMatchFilters" xml:space="preserve">
<value>没有项目符合当前筛选条件</value>
</data>
<data name="ReaderUnavailable" xml:space="preserve">
<value>没有可用的图书阅读器能够打开此图书格式。</value>
</data>
<data name="ReaderDisabled" xml:space="preserve">
<value>打开此图书的图书阅读器已在此媒体库中禁用。在媒体库设置中启用它即可阅读该图书。</value>
</data>
</root>
Loaded 100 of 271 files, more files were not shown because too many files have changed in this diff. Show more