Adds book details and editing with cover uploads across the stack

This commit is contained in:
BinaryAlley committed 2026-09-06 09:37:23 -07:00
1 parent c2715dea2e
commit 1bfa07ba5d
103 files changed
+8782 -387

No files matched your search

@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using System;
#endregion
namespace Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
/// <summary>
/// Extension methods for converting <see cref="GetBookRequest"/>.
/// </summary>
public static class GetBookRequestMapping
{
/// <summary>
/// Converts <paramref name="request"/> to <see cref="GetBookQuery"/>.
/// </summary>
/// <param name="request">The request to be converted.</param>
/// <returns>The converted query.</returns>
public static GetBookQuery ToQuery(this GetBookRequest request)
{
return new GetBookQuery(
Guid.TryParse(request.Id, out Guid bookId) ? bookId : Guid.Empty
);
}
}
@@ -0,0 +1,50 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
#endregion
namespace Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
/// <summary>
/// Extension methods for converting <see cref="UpdateBookCommand"/>.
/// </summary>
public static class UpdateBookCommandMapping
{
/// <summary>
/// Converts <paramref name="command"/> to <see cref="BookMetadataDto"/>, so that the edited data can be applied to the domain book.
/// </summary>
/// <param name="command">The command containing the edited data of the book.</param>
/// <returns>The built metadata.</returns>
public static BookMetadataDto ToBookMetadataDto(this UpdateBookCommand command)
{
return new BookMetadataDto(
Title: command.Metadata!.Title,
OriginalTitle: command.Metadata.OriginalTitle,
Description: command.Metadata.Description,
ReleaseInfo: command.Metadata.ReleaseInfo,
Genres: command.Metadata.Genres,
Tags: command.Metadata.Tags,
Language: command.Metadata.Language,
OriginalLanguage: command.Metadata.OriginalLanguage,
Publisher: command.Metadata.Publisher,
PageCount: command.Metadata.PageCount,
Format: command.Format,
Edition: command.Edition,
VolumeNumber: command.VolumeNumber,
Series: command.Series,
ASIN: command.ASIN,
GoodreadsId: command.GoodreadsId,
LCCN: command.LCCN,
OCLCNumber: command.OCLCNumber,
OpenLibraryId: command.OpenLibraryId,
LibraryThingId: command.LibraryThingId,
GoogleBooksId: command.GoogleBooksId,
BarnesAndNobleId: command.BarnesAndNobleId,
AppleBooksId: command.AppleBooksId,
Isbns: command.ISBNs,
Contributors: command.Contributors,
Ratings: command.Ratings,
CoverImagePath: null
);
}
}
@@ -0,0 +1,42 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using System;
#endregion
namespace Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
/// <summary>
/// Extension methods for converting <see cref="UpdateBookRequest"/>.
/// </summary>
public static class UpdateBookRequestMapping
{
/// <summary>
/// Converts <paramref name="request"/> to <see cref="UpdateBookCommand"/>.
/// </summary>
/// <param name="request">The request to be converted.</param>
/// <returns>The converted command.</returns>
public static UpdateBookCommand ToCommand(this UpdateBookRequest request)
{
return new UpdateBookCommand(
Guid.TryParse(request.Id, out Guid bookId) ? bookId : Guid.Empty,
request.Metadata,
request.Format,
request.Edition,
request.VolumeNumber,
request.Series,
request.ASIN,
request.GoodreadsId,
request.LCCN,
request.OCLCNumber,
request.OpenLibraryId,
request.LibraryThingId,
request.GoogleBooksId,
request.BarnesAndNobleId,
request.AppleBooksId,
request.ISBNs,
request.Contributors,
request.Ratings
);
}
}
@@ -2,6 +2,7 @@
using Lumina.Contracts.DTO.Common;
using Lumina.Domain.Common.Primitives;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -26,6 +27,20 @@ public interface IBookArtworkService
/// <returns>An <see cref="Result{TValue}"/> containing either the relative path of the stored artwork, or an error.</returns>
Task<Result<string>> SaveBookArtworkAsync(Guid libraryId, Guid bookId, string libraryName, string authorName, string bookTitle, ArtworkDto artwork, CancellationToken cancellationToken);
/// <summary>
/// Stores the artwork uploaded in the <paramref name="artworkStream"/> of the book into the internal media directory, and returns the relative path of the stored artwork.
/// </summary>
/// <param name="libraryId">The Id of the media library the book belongs to.</param>
/// <param name="bookId">The Id of the book.</param>
/// <param name="libraryName">The name of the media library the book belongs to.</param>
/// <param name="authorName">The name of the author of the book.</param>
/// <param name="bookTitle">The title of the book.</param>
/// <param name="artworkStream">The stream of the uploaded artwork file.</param>
/// <param name="fileName">The name of the uploaded artwork file.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either the relative path of the stored artwork, or an error.</returns>
Task<Result<string>> SaveBookArtworkAsync(Guid libraryId, Guid bookId, string libraryName, string authorName, string bookTitle, Stream artworkStream, string fileName, CancellationToken cancellationToken);
/// <summary>
/// Deletes the artwork of the book from the internal media directory.
/// </summary>
@@ -1,26 +1,30 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Primitives;
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.DataAccess.Repositories.Books;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Application.Common.DataAccess.Entities.MediaContributors;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.Infrastructure.Authentication;
using Lumina.Application.Common.Infrastructure.Authorization;
using Lumina.Application.Common.Infrastructure.Authorization.Policies.LibraryOwnership;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Common.ValueObjects.Metadata;
using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Entities;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Lumina.Contracts.DTO.MediaContributors;
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.AddBook;
@@ -31,16 +35,22 @@ namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary
public class AddBookCommandHandler : ICommandHandler<AddBookCommand, Result<BookResponse>>
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAuthorizationService _authorizationService;
private readonly ICurrentUserService _currentUserService;
private readonly IValidator<AddBookCommand> _validator;
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandHandler"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
/// <param name="validator">Injected validator for application validation rules.</param>
public AddBookCommandHandler(IUnitOfWork unitOfWork, IValidator<AddBookCommand> validator)
public AddBookCommandHandler(IUnitOfWork unitOfWork, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator<AddBookCommand> validator)
{
_unitOfWork = unitOfWork;
_authorizationService = authorizationService;
_currentUserService = currentUserService;
_validator = validator;
}
@@ -58,24 +68,31 @@ public class AddBookCommandHandler : ICommandHandler<AddBookCommand, Result<Book
if (validationResult.Count > 0)
return validationResult;
// TODO: update Api.Book.md documentation when the functionality is fully implemented
List<MediaContributorId> contributorIds = [];
foreach (MediaContributorDto mediaContributor in command.Contributors!)
{
// TODO: add logic to search the media contributors repository for existing contributors, based on the provided names
}
// An authenticated request must always carry a user identity.
Guid? currentUserId = _currentUserService.UserId;
if (currentUserId is null)
return ApplicationErrors.Authorization.NotAuthorized;
Guid userId = currentUserId.Value;
// Admins can add books to all libraries; for everyone else, only to the libraries they own.
bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(
userId, new LibraryOwnershipPolicyContext(command.LibraryId), cancellationToken).ConfigureAwait(false);
if (!canAccessLibrary)
return ApplicationErrors.Authorization.NotAuthorized;
// TODO: update Api.Book.md documentation when the functionality is fully implemented.
BookSeries? bookSeries = null;
if (command.Series != null)
{
// TODO: add logic to search the book series repository for existing book series, based on the provided title
// TODO: uncomment integration and unit tests about series
// TODO: add logic to search the book series repository for existing book series, based on the provided title.
// TODO: uncomment integration and unit tests about series.
}
List<Result<BookRating>> domainRatingsResult = command.Ratings!.ConvertAll(rating => BookRating.Create(
rating.Value ?? default,
rating.MaxValue ?? default,
Optional<BookRatingSource>.FromNullable(rating.Source.HasValue ? (BookRatingSource)(int)rating.Source : (BookRatingSource?)null),
Optional<int>.FromNullable(rating.VoteCount)));
// check if any of the results contain errors
// Check if any of the results contain errors.
List<Error> errors = [.. domainRatingsResult.Where(ratingResult => ratingResult.IsFailure).SelectMany(ratingResult => ratingResult.Errors)];
if (errors.Count != 0) // if there are errors, return them
return errors;
@@ -147,6 +164,28 @@ public class AddBookCommandHandler : ICommandHandler<AddBookCommand, Result<Book
);
if (metadataResult.IsFailure)
return metadataResult.Errors;
// Link the media contributors typed by the user to the book, finding or creating a single contributor per person; the same person
// can be credited under several roles, so every distinct display name must resolve to the same media contributor row.
List<MediaContributorId> contributorIds = [];
Dictionary<string, MediaContributorEntity> contributorsByDisplayName = [];
foreach (MediaContributorDto contributor in command.Contributors!)
{
if (contributor.Name?.DisplayName is null)
continue;
if (!contributorsByDisplayName.TryGetValue(contributor.Name.DisplayName, out MediaContributorEntity? contributorEntity))
{
Result<MediaContributorEntity> findOrCreateResult = await _unitOfWork.MediaContributorRepository.FindOrCreateByDisplayNameAsync(contributor.Name.DisplayName, contributor.Name.LegalName, cancellationToken).ConfigureAwait(false);
if (findOrCreateResult.IsFailure)
return findOrCreateResult.Errors;
contributorEntity = findOrCreateResult.Value;
contributorsByDisplayName.Add(contributor.Name.DisplayName, contributorEntity);
}
contributorIds.Add(MediaContributorId.Create(contributorEntity.Id));
}
Result<Book> createBookResult = Book.Create(
LibraryId.Create(command.LibraryId),
command.Path,
@@ -171,12 +210,27 @@ public class AddBookCommandHandler : ICommandHandler<AddBookCommand, Result<Book
if (createBookResult.IsFailure)
return createBookResult.Errors;
// The participation rows need the generated id of the book, so they are built once the domain book exists.
BookEntity persistenceBook = createBookResult.Value.ToRepositoryEntity();
persistenceBook.CreatedBy = userId;
persistenceBook.BookContributors = [.. command.Contributors!
.Where(contributor => contributor.Name?.DisplayName is not null)
.Select(contributor => new BookContributorEntity
{
Id = Guid.NewGuid(),
BookId = persistenceBook.Id,
MediaContributorId = contributorsByDisplayName[contributor.Name!.DisplayName!].Id,
RoleName = contributor.Role?.Name ?? "Contributor",
RoleCategory = contributor.Role?.Category ?? MediaContributorRoleCategory.Other,
CreatedOnUtc = DateTime.UtcNow,
CreatedBy = userId,
UpdatedBy = null
})];
Result<Created> insertBookResult = await _unitOfWork.BookRepository.InsertAsync(persistenceBook, cancellationToken).ConfigureAwait(false);
if (insertBookResult.IsFailure)
return insertBookResult.Errors;
await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
return persistenceBook.ToResponse();
return persistenceBook.ToResponse() with { Contributors = command.Contributors };
}
}
@@ -104,15 +104,7 @@ public class AddBookCommandValidator : AbstractValidator<AddBookCommand>
!releaseInfoInstance.OriginalReleaseDate.HasValue ||
reReleaseDate >= releaseInfoInstance.OriginalReleaseDate)
.When(r => r!.ReReleaseDate.HasValue && r.OriginalReleaseDate.HasValue)
.WithError(Errors.Metadata.ReReleaseDateCannotBeEarlierThanOriginalReleaseDate);
releaseInfo.RuleFor(r => r!.ReReleaseYear)
.Must((releaseInfoInstance, reReleaseYear) =>
!releaseInfoInstance!.ReReleaseDate.HasValue ||
!releaseInfoInstance.ReReleaseYear.HasValue ||
reReleaseYear == releaseInfoInstance.ReReleaseDate.Value.Year)
.When(r => r!.ReReleaseDate.HasValue && r.ReReleaseYear.HasValue)
.WithError(Errors.Metadata.ReReleaseDateAndYearMustMatch);
.WithError(Errors.Metadata.ReReleaseDateCannotBeEarlierThanOriginalReleaseDate);
});
metadata.RuleFor(m => m!.Genres)
@@ -0,0 +1,55 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
/// <summary>
/// Command for updating an existing book.
/// </summary>
/// <param name="Id">The Id of the book to update.</param>
/// <param name="Metadata">Written content metadata of the book.</param>
/// <param name="Format">The format of the book (e.g., Hardcover, Paperback), if applicable.</param>
/// <param name="Edition">The edition of the book, if applicable.</param>
/// <param name="VolumeNumber">The volume or book number in the series, if applicable.</param>
/// <param name="Series">The series name, if the book is part of a series.</param>
/// <param name="ASIN">The ASIN (Amazon Standard Identification Number) of the book, if applicable.</param>
/// <param name="GoodreadsId">The Goodreads ID of the book, if applicable.</param>
/// <param name="LCCN">The Library of Congress Control Number (LCCN) of the book, if applicable.</param>
/// <param name="OCLCNumber">The OCLC Number (WorldCat identifier) of the book, if applicable.</param>
/// <param name="OpenLibraryId">The Open Library ID of the book, if applicable.</param>
/// <param name="LibraryThingId">The LibraryThing ID of the book, if applicable.</param>
/// <param name="GoogleBooksId">The Google Books ID of the book, if applicable.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble ID of the book, if applicable.</param>
/// <param name="AppleBooksId">The Apple Books ID of the book, if applicable.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book.</param>
/// <param name="Contributors">The list of media contributors (actors, directors, etc) starring in this book.</param>
/// <param name="Ratings">The list of ratings for this book.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record UpdateBookCommand(
Guid Id,
WrittenContentMetadataDto? Metadata,
BookFormat? Format,
string? Edition,
float? VolumeNumber,
BookSeriesDto? Series,
string? ASIN,
string? GoodreadsId,
string? LCCN,
string? OCLCNumber,
string? OpenLibraryId,
string? LibraryThingId,
string? GoogleBooksId,
string? BarnesAndNobleId,
string? AppleBooksId,
List<IsbnDto>? ISBNs,
List<MediaContributorDto>? Contributors,
List<BookRatingDto>? Ratings
) : ICommand;
@@ -0,0 +1,154 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.DataAccess.Entities.MediaContributors;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.Infrastructure.Authentication;
using Lumina.Application.Common.Infrastructure.Authorization;
using Lumina.Application.Common.Infrastructure.Authorization.Policies.LibraryOwnership;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
/// <summary>
/// Handler for the command to update an existing book.
/// </summary>
public class UpdateBookCommandHandler : ICommandHandler<UpdateBookCommand, Result<BookResponse>>
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAuthorizationService _authorizationService;
private readonly ICurrentUserService _currentUserService;
private readonly IValidator<UpdateBookCommand> _validator;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCommandHandler"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
/// <param name="validator">Injected validator for application validation rules.</param>
public UpdateBookCommandHandler(IUnitOfWork unitOfWork, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator<UpdateBookCommand> validator)
{
_unitOfWork = unitOfWork;
_authorizationService = authorizationService;
_currentUserService = currentUserService;
_validator = validator;
}
/// <summary>
/// Handles the command to update an existing book.
/// </summary>
/// <param name="command">The command to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either the updated <see cref="BookResponse"/>, or an error message.
/// </returns>
public async Task<Result<BookResponse>> HandleAsync(UpdateBookCommand command, CancellationToken cancellationToken)
{
List<Error> validationResult = _validator.Validate(command);
if (validationResult.Count > 0)
return validationResult;
// An authenticated request must always carry a user identity.
Guid? currentUserId = _currentUserService.UserId;
if (currentUserId is null)
return ApplicationErrors.Authorization.NotAuthorized;
Guid userId = currentUserId.Value;
// Get the existing book with all its related data.
Result<BookEntity?> getBookResult = await _unitOfWork.BookRepository.GetByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
if (getBookResult.IsFailure)
return getBookResult.Errors;
if (getBookResult.Value is null)
return DomainErrors.WrittenContent.BookNotFound;
BookEntity existingBook = getBookResult.Value;
// Admins can update the books of all libraries; for everyone else, only the books of the libraries they own.
bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(
userId, new LibraryOwnershipPolicyContext(existingBook.LibraryId), cancellationToken).ConfigureAwait(false);
if (!canAccessLibrary)
return ApplicationErrors.Authorization.NotAuthorized;
// Convert the book to a domain object and apply the edited metadata to it.
Result<Book> getDomainBookResult = existingBook.ToDomainEntity();
if (getDomainBookResult.IsFailure)
return getDomainBookResult.Errors;
Book book = getDomainBookResult.Value;
Result<Success> applyMetadataResult = book.ApplyMetadata(command.ToBookMetadataDto());
if (applyMetadataResult.IsFailure)
return applyMetadataResult.Errors;
// Link the media contributors typed by the user to the book, finding or creating a single contributor per person.
List<BookContributorEntity> linkedContributors = [];
// A person can be credited under several roles in the same book; each distinct display name must resolve to the same media
// contributor row, otherwise the duplicate inserts would violate the unique display name constraint when the changes are saved.
Dictionary<string, MediaContributorEntity> contributorsByDisplayName = [];
foreach (MediaContributorDto contributor in command.Contributors!)
{
if (contributor.Name?.DisplayName is null)
continue;
if (!contributorsByDisplayName.TryGetValue(contributor.Name.DisplayName, out MediaContributorEntity? contributorEntity))
{
Result<MediaContributorEntity> findOrCreateResult = await _unitOfWork.MediaContributorRepository.FindOrCreateByDisplayNameAsync(contributor.Name.DisplayName, contributor.Name.LegalName, cancellationToken).ConfigureAwait(false);
if (findOrCreateResult.IsFailure)
return findOrCreateResult.Errors;
contributorEntity = findOrCreateResult.Value;
contributorsByDisplayName.Add(contributor.Name.DisplayName, contributorEntity);
}
string roleName = contributor.Role?.Name ?? "Contributor";
MediaContributorRoleCategory roleCategory = contributor.Role?.Category ?? MediaContributorRoleCategory.Other;
linkedContributors.Add(new BookContributorEntity
{
Id = Guid.NewGuid(),
BookId = existingBook.Id,
MediaContributorId = contributorEntity.Id,
RoleName = roleName,
RoleCategory = roleCategory,
CreatedOnUtc = DateTime.UtcNow,
CreatedBy = userId,
UpdatedBy = null
});
}
book.UpdateContributors([.. linkedContributors.Select(linkedContributor => MediaContributorId.Create(linkedContributor.MediaContributorId))]);
// Map the updated domain book onto a fresh repository entity, ready for the repository to replace the stored data.
BookEntity updatedBook = book.ToRepositoryEntity();
updatedBook.BookContributors = linkedContributors;
updatedBook.UpdatedOnUtc = DateTime.UtcNow;
updatedBook.UpdatedBy = userId;
// The identity, enrichment and artwork columns are never overwritten by an edit, so they are copied onto the fresh entity that
// backs the response; without this, the response would report the fresh entity defaults (Pending metadata status, no cover path).
updatedBook.CreatedOnUtc = existingBook.CreatedOnUtc;
updatedBook.MetadataStatus = existingBook.MetadataStatus;
updatedBook.LastMetadataUpdateUtc = existingBook.LastMetadataUpdateUtc;
updatedBook.MetadataProvider = existingBook.MetadataProvider;
updatedBook.BookArtwork = existingBook.BookArtwork;
Result<Updated> updateResult = await _unitOfWork.BookRepository.UpdateAsync(updatedBook, cancellationToken).ConfigureAwait(false);
if (updateResult.IsFailure)
return updateResult.Errors;
await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
return updatedBook.ToResponse() with { Contributors = command.Contributors };
}
}
@@ -0,0 +1,345 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Utilities;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using System;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
/// <summary>
/// Validates the needed validation rules for <see cref="UpdateBookCommand"/>.
/// </summary>
public class UpdateBookCommandValidator : AbstractValidator<UpdateBookCommand>
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCommandValidator"/> class.
/// </summary>
public UpdateBookCommandValidator()
{
RuleFor(command => command.Id)
.NotEmpty()
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty)
.Must(id => id != Guid.Empty)
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty);
RuleFor(command => command.Metadata)
.NotNull()
.WithError(Errors.Metadata.MetadataCannotBeNull)
.ChildRules(metadata =>
{
metadata.RuleFor(m => m!.Title)
.NotEmpty()
.WithError(Errors.Metadata.TitleCannotBeEmpty)
.MaximumLength(255)
.WithError(Errors.Metadata.TitleMustBeMaximum255CharactersLong);
metadata.RuleFor(m => m!.OriginalTitle)
.MaximumLength(255)
.When(m => m!.OriginalTitle is not null)
.WithError(Errors.Metadata.OriginalTitleMustBeMaximum255CharactersLong);
metadata.RuleFor(m => m!.Description)
.MaximumLength(2000)
.When(m => m!.Description is not null)
.WithError(Errors.Metadata.DescriptionMustBeMaximum2000CharactersLong);
metadata.RuleFor(m => m!.ReleaseInfo)
.NotNull()
.WithError(Errors.Metadata.ReleaseInfoCannotBeNull)
.ChildRules(releaseInfo =>
{
releaseInfo.RuleFor(r => r!.OriginalReleaseYear)
.InclusiveBetween(1, 9999)
.When(r => r!.OriginalReleaseYear.HasValue)
.WithError(Errors.Metadata.OriginalReleaseYearMustBeBetween1And9999);
releaseInfo.RuleFor(r => r!.ReReleaseYear)
.InclusiveBetween(1, 9999)
.When(r => r!.ReReleaseYear.HasValue)
.WithError(Errors.Metadata.ReReleaseYearMustBeBetween1And9999);
releaseInfo.RuleFor(r => r!.ReleaseCountry)
.Matches("^[A-Za-z]{2}$")
.When(r => r!.ReleaseCountry is not null)
.WithError(Errors.Metadata.CountryCodeMustBe2CharactersLong);
releaseInfo.RuleFor(r => r!.ReleaseVersion)
.MaximumLength(50)
.When(r => r!.ReleaseVersion is not null)
.WithError(Errors.Metadata.ReleaseVersionMustBeMaximum50CharactersLong);
releaseInfo.RuleFor(r => r!.OriginalReleaseYear)
.Must((releaseInfoInstance, originalReleaseYear) =>
!releaseInfoInstance!.OriginalReleaseDate.HasValue ||
!releaseInfoInstance.OriginalReleaseYear.HasValue ||
originalReleaseYear == releaseInfoInstance.OriginalReleaseDate.Value.Year)
.When(r => r!.OriginalReleaseDate.HasValue && r.OriginalReleaseYear.HasValue)
.WithError(Errors.Metadata.OriginalReleaseDateAndYearMustMatch);
releaseInfo.RuleFor(r => r!.ReReleaseYear)
.Must((releaseInfoInstance, reReleaseYear) =>
!releaseInfoInstance!.ReReleaseDate.HasValue ||
!releaseInfoInstance.ReReleaseYear.HasValue ||
reReleaseYear == releaseInfoInstance.ReReleaseDate.Value.Year)
.When(r => r!.ReReleaseDate.HasValue && r.ReReleaseYear.HasValue)
.WithError(Errors.Metadata.ReReleaseDateAndYearMustMatch);
releaseInfo.RuleFor(r => r!.ReReleaseYear)
.Must((releaseInfoInstance, reReleaseYear) =>
!releaseInfoInstance!.ReReleaseYear.HasValue ||
!releaseInfoInstance.OriginalReleaseYear.HasValue ||
reReleaseYear >= releaseInfoInstance.OriginalReleaseYear)
.When(r => r!.ReReleaseYear.HasValue && r.OriginalReleaseYear.HasValue)
.WithError(Errors.Metadata.ReReleaseYearCannotBeEarlierThanOriginalReleaseYear);
releaseInfo.RuleFor(r => r!.ReReleaseDate)
.Must((releaseInfoInstance, reReleaseDate) =>
!releaseInfoInstance!.ReReleaseDate.HasValue ||
!releaseInfoInstance.OriginalReleaseDate.HasValue ||
reReleaseDate >= releaseInfoInstance.OriginalReleaseDate)
.When(r => r!.ReReleaseDate.HasValue && r.OriginalReleaseDate.HasValue)
.WithError(Errors.Metadata.ReReleaseDateCannotBeEarlierThanOriginalReleaseDate);
});
metadata.RuleFor(m => m!.Genres)
.NotNull()
.WithError(Errors.Metadata.GenresListCannotBeNull);
metadata.RuleForEach(m => m!.Genres)
.ChildRules(genre =>
genre.RuleFor(g => g.Name)
.NotEmpty()
.WithError(Errors.Metadata.GenreNameCannotBeEmpty)
.MaximumLength(50)
.WithError(Errors.Metadata.GenreNameMustBeMaximum50CharactersLong));
metadata.RuleFor(m => m!.Tags)
.NotNull()
.WithError(Errors.Metadata.TagsListCannotBeNull);
metadata.RuleForEach(m => m!.Tags)
.ChildRules(tag =>
tag.RuleFor(t => t.Name)
.NotEmpty()
.WithError(Errors.Metadata.TagNameCannotBeEmpty)
.MaximumLength(50)
.WithError(Errors.Metadata.TagNameMustBeMaximum50CharactersLong));
metadata.RuleFor(m => m!.Language!.LanguageCode)
.NotEmpty()
.WithError(Errors.Metadata.LanguageCodeCannotBeEmpty)
.MaximumLength(2)
.WithError(Errors.Metadata.LanguageCodeMustBe2CharactersLong)
.When(m => m!.Language is not null);
metadata.RuleFor(m => m!.Language!.LanguageName)
.NotEmpty()
.WithError(Errors.Metadata.LanguageNameCannotBeEmpty)
.MaximumLength(50)
.WithError(Errors.Metadata.LanguageNameMustBeMaximum50CharactersLong)
.When(m => m!.Language is not null);
metadata.RuleFor(m => m!.Language!.NativeName)
.MaximumLength(50)
.WithError(Errors.Metadata.LanguageNativeNameMustBeMaximum50CharactersLong)
.When(m => m!.Language is not null);
metadata.RuleFor(m => m!.OriginalLanguage!.LanguageCode)
.NotEmpty()
.WithError(Errors.Metadata.LanguageCodeCannotBeEmpty)
.MaximumLength(2)
.WithError(Errors.Metadata.LanguageCodeMustBe2CharactersLong)
.When(m => m!.OriginalLanguage is not null);
metadata.RuleFor(m => m!.OriginalLanguage!.LanguageName)
.NotEmpty()
.WithError(Errors.Metadata.LanguageNameCannotBeEmpty)
.MaximumLength(50)
.WithError(Errors.Metadata.LanguageNameMustBeMaximum50CharactersLong)
.When(m => m!.OriginalLanguage is not null);
metadata.RuleFor(m => m!.OriginalLanguage!.NativeName)
.MaximumLength(50)
.WithError(Errors.Metadata.LanguageNativeNameMustBeMaximum50CharactersLong)
.When(m => m!.OriginalLanguage is not null);
metadata.RuleFor(m => m!.Publisher)
.MaximumLength(100)
.When(m => m!.Publisher is not null)
.WithError(Errors.WrittenContent.PublisherMustBeMaximum100CharactersLong);
metadata.RuleFor(m => m!.PageCount)
.GreaterThan(0)
.When(m => m!.PageCount.HasValue)
.WithError(Errors.WrittenContent.PageCountMustBeGreaterThanZero);
});
RuleFor(command => command.Format)
.IsInEnum()
.When(command => command.Format is not null)
.WithError(Errors.WrittenContent.UnknownBookFormat);
RuleFor(command => command.Edition)
.MaximumLength(50)
.When(command => command.Edition is not null)
.WithError(Errors.WrittenContent.EditionMustBeMaximum50CharactersLong);
RuleFor(command => command.VolumeNumber)
.GreaterThan(0)
.When(command => command.VolumeNumber.HasValue)
.WithError(Errors.WrittenContent.VolumeNumberMustBeGreaterThanZero);
RuleFor(command => command.Series)
.ChildRules(series =>
series.RuleFor(s => s!.Title)
.NotEmpty()
.WithError(Errors.Metadata.TitleCannotBeEmpty)
.MaximumLength(255)
.WithError(Errors.Metadata.TitleMustBeMaximum255CharactersLong))
.When(command => command.Series is not null);
RuleFor(command => command.ASIN)
.Length(10)
.When(command => command.ASIN is not null)
.WithError(Errors.WrittenContent.AsinMustBe10CharactersLong);
RuleFor(command => command.GoodreadsId)
.Matches(@"^\d+$")
.When(command => command.GoodreadsId is not null)
.WithError(Errors.WrittenContent.GoodreadsIdMustBeNumeric);
RuleFor(command => command.LCCN)
.Matches(@"^[a-z]{0,3}\d{8,10}$")
.When(command => command.LCCN is not null)
.WithError(Errors.WrittenContent.InvalidLccnFormat);
RuleFor(command => command.OCLCNumber)
.Matches(@"^(ocm\d{8}|ocn\d{9,}|on\d{10,}|\(OCoLC\)\d{8,}|\d{8,})$")
.When(command => command.OCLCNumber is not null)
.WithError(Errors.WrittenContent.InvalidOclcFormat);
RuleFor(command => command.OpenLibraryId)
.Matches(@"^OL[1-9]\d*[AMW]$")
.When(command => command.OpenLibraryId is not null)
.WithError(Errors.WrittenContent.InvalidOpenLibraryId);
RuleFor(command => command.LibraryThingId)
.MaximumLength(50)
.When(command => command.LibraryThingId is not null)
.WithError(Errors.WrittenContent.LibraryThingIdMustBeMaximum50CharactersLong);
RuleFor(command => command.GoogleBooksId)
.Length(12)
.When(command => command.GoogleBooksId is not null)
.WithError(Errors.WrittenContent.GoogleBooksIdMustBe12CharactersLong)
.Matches(@"^[A-Za-z0-9_-]{12}$")
.When(command => command.GoogleBooksId is not null)
.WithError(Errors.WrittenContent.InvalidGoogleBooksIdFormat);
RuleFor(command => command.BarnesAndNobleId)
.Length(10)
.When(command => command.BarnesAndNobleId is not null)
.WithError(Errors.WrittenContent.BarnesAndNoblesIdMustBe10CharactersLong)
.Matches(@"^\d{10}$")
.When(command => command.BarnesAndNobleId is not null)
.WithError(Errors.WrittenContent.InvalidBarnesAndNoblesIdFormat);
RuleFor(command => command.AppleBooksId)
.Matches(@"^id\d+$")
.When(command => command.AppleBooksId is not null)
.WithError(Errors.WrittenContent.InvalidAppleBooksIdFormat);
RuleFor(command => command.ISBNs)
.NotNull()
.WithError(Errors.WrittenContent.IsbnListCannotBeNull);
RuleForEach(command => command.ISBNs)
.ChildRules(isbn =>
{
isbn.RuleFor(i => i.Value)
.NotEmpty()
.WithError(Errors.WrittenContent.IsbnValueCannotBeEmpty);
isbn.RuleFor(i => i.Value)
.Matches(@"^(?:ISBN(?:-13)?:? )?(?=[0-9]{13}$|(?=(?:[0-9]+[-\ ]){4})[-\ 0-9]{17}$)97[89][-\ ]?[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]$")
.When(i => i.Format == IsbnFormat.Isbn13)
.WithError(Errors.WrittenContent.InvalidIsbn13Format);
isbn.RuleFor(i => i.Value)
.Matches(@"^(?:ISBN(?:-10)?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[-\ ]){3})[-\ 0-9X]{13}$)[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9X]$")
.When(i => i.Format == IsbnFormat.Isbn10)
.WithError(Errors.WrittenContent.InvalidIsbn10Format);
isbn.RuleFor(i => i.Format)
.IsInEnum()
.WithError(Errors.WrittenContent.UnknownIsbnFormat);
});
RuleFor(command => command.Contributors)
.NotNull()
.WithError(Errors.MediaContributor.ContributorsListCannotBeNull);
RuleForEach(command => command.Contributors)
.ChildRules(contributor =>
{
contributor.RuleFor(c => c.Name)
.NotNull()
.WithError(Errors.MediaContributor.ContributorNameCannotBeEmpty)
.ChildRules(name =>
{
name.RuleFor(n => n!.DisplayName)
.NotNull()
.WithError(Errors.MediaContributor.ContributorDisplayNameCannotBeEmpty)
.NotEmpty()
.WithError(Errors.MediaContributor.ContributorDisplayNameCannotBeEmpty)
.MaximumLength(100)
.WithError(Errors.MediaContributor.ContributorDisplayNameMustBeMaximum100CharactersLong);
name.RuleFor(n => n!.LegalName)
.MaximumLength(100)
.When(n => n!.LegalName is not null)
.WithError(Errors.MediaContributor.ContributorLegalNameMustBeMaximum100CharactersLong);
});
contributor.RuleFor(c => c.Role)
.NotNull()
.WithError(Errors.MediaContributor.ContributorRoleCannotBeNull)
.ChildRules(role =>
{
role.RuleFor(r => r!.Name)
.NotEmpty()
.WithError(Errors.MediaContributor.RoleNameCannotBeEmpty)
.MaximumLength(50)
.WithError(Errors.MediaContributor.RoleNameMustBeMaximum50CharactersLong);
role.RuleFor(r => r!.Category)
.NotEmpty()
.WithError(Errors.MediaContributor.RoleCategoryCannotBeEmpty);
});
});
RuleFor(command => command.Ratings)
.NotNull()
.WithError(Errors.Metadata.RatingsListCannotBeNull);
RuleForEach(command => command.Ratings)
.ChildRules(rating =>
{
rating.RuleFor(r => r.Value)
.GreaterThan(0)
.WithError(Errors.Metadata.RatingValueMustBePositive)
.Must((ratingInstance, value) => value <= ratingInstance.MaxValue)
.WithError(Errors.Metadata.RatingValueCannotBeGreaterThanMaxValue);
rating.RuleFor(r => r.MaxValue)
.GreaterThan(0)
.WithError(Errors.Metadata.RatingMaxValueMustBePositive);
rating.RuleFor(r => r.VoteCount)
.GreaterThanOrEqualTo(0)
.When(r => r.VoteCount.HasValue)
.WithError(Errors.Metadata.RatingVoteCountMustBePositive);
});
}
}
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using System;
using System.Diagnostics;
using System.IO;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBookCover;
/// <summary>
/// Command for updating the cover image of an existing book.
/// </summary>
/// <param name="BookId">The Id of the book whose cover image is updated.</param>
/// <param name="Cover">The stream of the uploaded cover image file.</param>
/// <param name="FileName">The name of the uploaded cover image file.</param>
[DebuggerDisplay("BookId: {BookId} FileName: {FileName}")]
public record UpdateBookCoverCommand(
Guid BookId,
Stream? Cover,
string? FileName
) : ICommand;
@@ -0,0 +1,161 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.DataAccess.Entities.MediaContributors;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.Infrastructure.Authentication;
using Lumina.Application.Common.Infrastructure.Authorization;
using Lumina.Application.Common.Infrastructure.Authorization.Policies.LibraryOwnership;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Artwork;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBookCover;
/// <summary>
/// Handler for the command to update the cover image of an existing book.
/// </summary>
public class UpdateBookCoverCommandHandler : ICommandHandler<UpdateBookCoverCommand, Result<string>>
{
private readonly IUnitOfWork _unitOfWork;
private readonly IBookArtworkService _bookArtworkService;
private readonly IAuthorizationService _authorizationService;
private readonly ICurrentUserService _currentUserService;
private readonly IValidator<UpdateBookCoverCommand> _validator;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverCommandHandler"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="bookArtworkService">Injected service for storing the artwork of a book.</param>
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
/// <param name="validator">Injected validator for application validation rules.</param>
public UpdateBookCoverCommandHandler(IUnitOfWork unitOfWork, IBookArtworkService bookArtworkService, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator<UpdateBookCoverCommand> validator)
{
_unitOfWork = unitOfWork;
_bookArtworkService = bookArtworkService;
_authorizationService = authorizationService;
_currentUserService = currentUserService;
_validator = validator;
}
/// <summary>
/// Handles the command to update the cover image of an existing book.
/// </summary>
/// <param name="command">The command to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either the relative path of the stored cover image, or an error message.
/// </returns>
public async Task<Result<string>> HandleAsync(UpdateBookCoverCommand command, CancellationToken cancellationToken)
{
List<Error> validationResult = _validator.Validate(command);
if (validationResult.Count > 0)
return validationResult;
// An authenticated request must always carry a user identity.
Guid? currentUserId = _currentUserService.UserId;
if (currentUserId is null)
return ApplicationErrors.Authorization.NotAuthorized;
Guid userId = currentUserId.Value;
// Get the existing book with its artwork.
Result<BookEntity?> getBookResult = await _unitOfWork.BookRepository.GetByIdAsync(command.BookId, cancellationToken).ConfigureAwait(false);
if (getBookResult.IsFailure)
return getBookResult.Errors;
if (getBookResult.Value is null)
return DomainErrors.WrittenContent.BookNotFound;
BookEntity existingBook = getBookResult.Value;
// Admins can update the books of all libraries; for everyone else, only the books of the libraries they own.
bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(
userId, new LibraryOwnershipPolicyContext(existingBook.LibraryId), cancellationToken).ConfigureAwait(false);
if (!canAccessLibrary)
return ApplicationErrors.Authorization.NotAuthorized;
// The artwork is stored under the library and author segments, so their names are resolved to keep the location consistent with the scanned artwork.
Result<LibraryEntity?> getLibraryResult = await _unitOfWork.LibraryRepository.GetByIdAsync(existingBook.LibraryId, cancellationToken).ConfigureAwait(false);
if (getLibraryResult.IsFailure)
return getLibraryResult.Errors;
if (getLibraryResult.Value is null)
return DomainErrors.Library.LibraryNotFound;
string libraryName = getLibraryResult.Value.Title;
string authorName = await GetAuthorNameAsync(existingBook, cancellationToken).ConfigureAwait(false);
Result<string> storeArtworkResult = await _bookArtworkService.SaveBookArtworkAsync(
existingBook.LibraryId,
existingBook.Id,
libraryName,
authorName,
existingBook.Title,
command.Cover!,
command.FileName!,
cancellationToken).ConfigureAwait(false);
if (storeArtworkResult.IsFailure)
return storeArtworkResult.Errors;
// Update the stored cover artwork of the book with the newly stored image.
BookArtworkEntity? coverArtwork = existingBook.BookArtwork.FirstOrDefault(artwork => artwork.ArtworkType == ArtworkType.Cover);
if (coverArtwork is null)
{
existingBook.BookArtwork.Add(new BookArtworkEntity
{
Id = Guid.NewGuid(),
BookId = existingBook.Id,
ArtworkType = ArtworkType.Cover,
Ordinal = 0,
FileName = storeArtworkResult.Value,
Status = ArtworkStatus.Enriched,
CreatedOnUtc = DateTime.UtcNow,
CreatedBy = userId,
UpdatedBy = null
});
}
else
{
coverArtwork.FileName = storeArtworkResult.Value;
coverArtwork.Status = ArtworkStatus.Enriched;
coverArtwork.LastUpdateUtc = DateTime.UtcNow;
coverArtwork.UpdatedOnUtc = DateTime.UtcNow;
coverArtwork.UpdatedBy = userId;
}
await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
return storeArtworkResult.Value;
}
/// <summary>
/// Gets the display name of the author of the <paramref name="book"/>, used to build the artwork storage path, or an empty string when the book has no author.
/// </summary>
/// <param name="book">The book whose author is retrieved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The display name of the author of the book, or an empty string.</returns>
private async Task<string> GetAuthorNameAsync(BookEntity book, CancellationToken cancellationToken)
{
IReadOnlyCollection<Guid> authorIds = [.. book.BookContributors
.Where(participation => participation.RoleCategory == MediaContributorRoleCategory.Author)
.Select(participation => participation.MediaContributorId)
.Distinct()];
if (authorIds.Count == 0)
return string.Empty;
Result<IReadOnlyList<MediaContributorEntity>> getContributorsResult = await _unitOfWork.MediaContributorRepository.GetByIdsAsync(authorIds, cancellationToken).ConfigureAwait(false);
if (getContributorsResult.IsFailure)
return string.Empty;
return getContributorsResult.Value.Select(contributor => contributor.DisplayName).FirstOrDefault() ?? string.Empty;
}
}
@@ -0,0 +1,30 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Utilities;
using Lumina.Domain.Common.Errors;
using System;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBookCover;
/// <summary>
/// Validates the needed validation rules for <see cref="UpdateBookCoverCommand"/>.
/// </summary>
public class UpdateBookCoverCommandValidator : AbstractValidator<UpdateBookCoverCommand>
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverCommandValidator"/> class.
/// </summary>
public UpdateBookCoverCommandValidator()
{
RuleFor(command => command.BookId)
.NotEmpty()
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty)
.Must(id => id != Guid.Empty)
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty);
RuleFor(command => command.Cover)
.NotNull()
.WithError(Errors.WrittenContent.BookCoverCannotBeNull);
}
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using System;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
/// <summary>
/// Query for getting a book by its Id.
/// </summary>
/// <param name="Id">The Id of the book to get.</param>
public record GetBookQuery(
Guid Id
) : IQuery;
@@ -0,0 +1,122 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.DataAccess.Entities.MediaContributors;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.Infrastructure.Authentication;
using Lumina.Application.Common.Infrastructure.Authorization;
using Lumina.Application.Common.Infrastructure.Authorization.Policies.LibraryOwnership;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.Common.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
/// <summary>
/// Handler for the query to get a book by its Id.
/// </summary>
public class GetBookQueryHandler : IQueryHandler<GetBookQuery, Result<BookResponse>>
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAuthorizationService _authorizationService;
private readonly ICurrentUserService _currentUserService;
private readonly IValidator<GetBookQuery> _validator;
/// <summary>
/// Initializes a new instance of the <see cref="GetBookQueryHandler"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
/// <param name="validator">Injected validator for application validation rules.</param>
public GetBookQueryHandler(IUnitOfWork unitOfWork, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator<GetBookQuery> validator)
{
_unitOfWork = unitOfWork;
_authorizationService = authorizationService;
_currentUserService = currentUserService;
_validator = validator;
}
/// <summary>
/// Handles the query to get a book by its Id.
/// </summary>
/// <param name="query">The query to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either the requested <see cref="BookResponse"/>, or an error message.
/// </returns>
public async Task<Result<BookResponse>> HandleAsync(GetBookQuery query, CancellationToken cancellationToken)
{
List<Error> validationResult = _validator.Validate(query);
if (validationResult.Count > 0)
return validationResult;
// An authenticated request must always carry a user identity.
Guid? currentUserId = _currentUserService.UserId;
if (currentUserId is null)
return ApplicationErrors.Authorization.NotAuthorized;
Guid userId = currentUserId.Value;
// Get the book with the specified id from the repository.
Result<BookEntity?> getBookResult = await _unitOfWork.BookRepository.GetByIdAsync(query.Id, cancellationToken).ConfigureAwait(false);
if (getBookResult.IsFailure)
return getBookResult.Errors;
if (getBookResult.Value is null)
return DomainErrors.WrittenContent.BookNotFound;
// Admins can see the books of all libraries; for everyone else, only the books of the libraries they own.
bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(
userId, new LibraryOwnershipPolicyContext(getBookResult.Value.LibraryId), cancellationToken).ConfigureAwait(false);
if (!canAccessLibrary)
return ApplicationErrors.Authorization.NotAuthorized;
BookResponse response = getBookResult.Value.ToResponse();
// The response carries the resolved contributor names, so that the clients can display them without querying the contributors themselves.
List<MediaContributorEntity> contributors = await GetContributorsAsync(getBookResult.Value, cancellationToken).ConfigureAwait(false);
if (contributors.Count == 0)
return response;
Dictionary<Guid, MediaContributorEntity> contributorsById = contributors.ToDictionary(contributor => contributor.Id);
List<MediaContributorDto> contributorResponses = [];
foreach (BookContributorEntity participation in getBookResult.Value.BookContributors)
{
if (!contributorsById.TryGetValue(participation.MediaContributorId, out MediaContributorEntity? contributor))
continue;
contributorResponses.Add(new MediaContributorDto(
new MediaContributorNameDto(contributor.DisplayName, contributor.LegalName),
new MediaContributorRoleDto(participation.RoleName, participation.RoleCategory)
));
}
return response with { Contributors = contributorResponses };
}
/// <summary>
/// Gets the media contributors linked to the book of <paramref name="book"/>, by their unique identifiers.
/// </summary>
/// <param name="book">The book whose media contributors are retrieved.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either the media contributors of the book, or an error.</returns>
private async Task<List<MediaContributorEntity>> GetContributorsAsync(BookEntity book, CancellationToken cancellationToken)
{
IReadOnlyCollection<Guid> contributorIds = [.. book.BookContributors.Select(participation => participation.MediaContributorId).Distinct()];
if (contributorIds.Count == 0)
return [];
Result<IReadOnlyList<MediaContributorEntity>> getContributorsResult = await _unitOfWork.MediaContributorRepository.GetByIdsAsync(contributorIds, cancellationToken).ConfigureAwait(false);
if (getContributorsResult.IsFailure)
return [];
return [.. getContributorsResult.Value];
}
}
@@ -0,0 +1,26 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Utilities;
using Lumina.Domain.Common.Errors;
using System;
#endregion
namespace Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
/// <summary>
/// Validates the needed validation rules for <see cref="GetBookQuery"/>.
/// </summary>
public class GetBookQueryValidator : AbstractValidator<GetBookQuery>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetBookQueryValidator"/> class.
/// </summary>
public GetBookQueryValidator()
{
RuleFor(query => query.Id)
.NotEmpty()
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty)
.Must(id => id != Guid.Empty)
.WithError(Errors.WrittenContent.BookIdCannotBeEmpty);
}
}
@@ -0,0 +1,53 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
/// <summary>
/// Represents a request to update an existing book.
/// </summary>
/// <param name="Id">The Id of the book to update, taken from the route. Required.</param>
/// <param name="Metadata">Written content metadata of the book. Required.</param>
/// <param name="Format">The format of the book (e.g., Hardcover, Paperback). Optional.</param>
/// <param name="Edition">The edition of the book. Optional.</param>
/// <param name="VolumeNumber">The volume or book number in the series. Optional.</param>
/// <param name="Series">The series name, if the book is part of a series. Optional.</param>
/// <param name="ASIN">The ASIN (Amazon Standard Identification Number) of the book. Optional.</param>
/// <param name="GoodreadsId">The Goodreads Id of the book. Optional.</param>
/// <param name="LCCN">The Library of Congress Control Number (LCCN) of the book. Optional.</param>
/// <param name="OCLCNumber">The OCLC Number (WorldCat identifier) of the book. Optional.</param>
/// <param name="OpenLibraryId">The Open Library Id of the book. Optional.</param>
/// <param name="LibraryThingId">The LibraryThing Id of the book. Optional.</param>
/// <param name="GoogleBooksId">The Google Books Id of the book. Optional.</param>
/// <param name="BarnesAndNobleId">The Barnes & Noble Id of the book. Optional.</param>
/// <param name="AppleBooksId">The Apple Books Id of the book. Optional.</param>
/// <param name="ISBNs">The list of ISBN (International Standard Book Number) of the book. Required.</param>
/// <param name="Contributors">The list of media contributors (actors, directors, etc) starring in this book. Required.</param>
/// <param name="Ratings">The list of ratings for this book. Required.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record UpdateBookRequest(
string? Id,
WrittenContentMetadataDto? Metadata,
BookFormat? Format,
string? Edition,
float? VolumeNumber,
BookSeriesDto? Series,
string? ASIN,
string? GoodreadsId,
string? LCCN,
string? OCLCNumber,
string? OpenLibraryId,
string? LibraryThingId,
string? GoogleBooksId,
string? BarnesAndNobleId,
string? AppleBooksId,
List<IsbnDto>? ISBNs,
List<MediaContributorDto>? Contributors,
List<BookRatingDto>? Ratings
);
@@ -58,7 +58,7 @@ internal sealed class BookRepository : IBookRepository
if (bookExists)
return Errors.WrittenContent.BookAlreadyExists;
// fetch existing tags and genres
// Fetch existing tags and genres.
List<TagEntity> existingTags = await _luminaDbContext.Set<TagEntity>()
.Where(t => book.Tags.Select(bt => bt.Name).Contains(t.Name))
.ToListAsync(cancellationToken).ConfigureAwait(false);
@@ -67,7 +67,7 @@ internal sealed class BookRepository : IBookRepository
.Where(g => book.Genres.Select(bg => bg.Name).Contains(g.Name))
.ToListAsync(cancellationToken).ConfigureAwait(false);
// replace tags and genres in the book with existing ones
// Replace tags and genres in the book with existing ones.
book.Tags = [.. book.Tags.Select(tag => existingTags.FirstOrDefault(existingTag => existingTag.Name == tag.Name) ?? tag)];
book.Genres = [.. book.Genres.Select(genre => existingGenres.FirstOrDefault(existingGenre => existingGenre.Name == genre.Name) ?? genre)];
@@ -87,6 +87,8 @@ internal sealed class BookRepository : IBookRepository
.Include(book => book.Tags)
.Include(book => book.Genres)
.Include(book => book.ISBNs)
.Include(book => book.Ratings)
.Include(book => book.BookContributors)
.Include(book => book.BookArtwork)
.FirstOrDefaultAsync(book => book.Id == id, cancellationToken).ConfigureAwait(false);
}
@@ -102,6 +104,8 @@ internal sealed class BookRepository : IBookRepository
.Include(book => book.Tags)
.Include(book => book.Genres)
.Include(book => book.ISBNs)
.Include(book => book.Ratings)
.Include(book => book.BookContributors)
.Include(book => book.BookArtwork)
.ToListAsync(cancellationToken).ConfigureAwait(false);
}
@@ -126,21 +130,21 @@ internal sealed class BookRepository : IBookRepository
.Include(book => book.BookArtwork)
.AsNoTracking();
// books should always be retrieved only per owning libraries
// Books should always be retrieved only per owning libraries.
if (filterModel is not LibraryFilterDto libraryFilter || libraryFilter.LibraryId == Guid.Empty)
return Errors.Library.FilterMustIncludeLibraryId;
booksQuery = booksQuery.Where(book => book.LibraryId == libraryFilter.LibraryId);
FilterSpecification<BookEntity>? filterSpecification = BuildFilterSpecification(libraryFilter);
// apply filtering
// Apply filtering.
if (filterSpecification is not null)
booksQuery = booksQuery.Where(filterSpecification.ToExpression());
// apply sorting based on the specified sortBy and sortOrder parameters
// Apply sorting based on the specified sortBy and sortOrder parameters.
booksQuery = ApplySorting(booksQuery, sortBy, sortOrder ?? SortOrder.Ascending, libraryFilter.ShouldIgnoreThePrefixForAlphaPicker);
// if no pagination was requested, return all the books of the library
// If no pagination was requested, return all the books of the library.
if (paginationData is null)
{
IReadOnlyList<BookEntity> allBooks = await booksQuery.ToListAsync(cancellationToken).ConfigureAwait(false);
@@ -156,9 +160,9 @@ internal sealed class BookRepository : IBookRepository
int count = await booksQuery.Select(book => book.Id).CountAsync(cancellationToken).ConfigureAwait(false);
int numberOfPages = (int)Math.Ceiling((double)count / paginationData.PerPage);
int currentPage = Math.Min(paginationData.CurrentPage, Math.Max(1, numberOfPages)); // make sure current page doesn't exceed maximum number of pages
int currentPage = Math.Min(paginationData.CurrentPage, Math.Max(1, numberOfPages)); // Make sure current page doesn't exceed maximum number of pages.
// apply pagination
// Apply pagination.
IReadOnlyList<BookEntity> paginatedResult = await booksQuery
.Skip((currentPage - 1) * paginationData.PerPage)
.Take(paginationData.PerPage)
@@ -359,7 +363,7 @@ internal sealed class BookRepository : IBookRepository
return authorRows
.GroupBy(row => row.BookId)
.ToDictionary(group => group.Key, group => (string?)group.Min(row => row.DisplayName));
.ToDictionary(group => group.Key, group => group.Min(row => row.DisplayName));
}
/// <summary>
@@ -387,9 +391,9 @@ internal sealed class BookRepository : IBookRepository
}
/// <summary>
/// Updates a book.
/// Updates a book, replacing its editable data while preserving its identity, enrichment and audit columns.
/// </summary>
/// <param name="data">The book to update.</param>
/// <param name="data">The book whose editable data is applied to the stored book.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<Result<Updated>> UpdateAsync(BookEntity data, CancellationToken cancellationToken)
@@ -398,11 +402,52 @@ internal sealed class BookRepository : IBookRepository
.Include(book => book.Tags)
.Include(book => book.Genres)
.Include(book => book.ISBNs)
.Include(book => book.Ratings)
.Include(book => book.BookContributors)
.FirstOrDefaultAsync(book => book.Id == data.Id, cancellationToken).ConfigureAwait(false);
if (foundBook is null)
return Errors.WrittenContent.BookNotFound;
// update the scalar properties of the book
// The stored enrichment and identity columns are never overwritten by an edit: they are owned by the scan and by the record itself.
Guid libraryId = foundBook.LibraryId;
string path = foundBook.Path;
MetadataStatus metadataStatus = foundBook.MetadataStatus;
DateTime? lastMetadataUpdateUtc = foundBook.LastMetadataUpdateUtc;
string? metadataProvider = foundBook.MetadataProvider;
DateTime createdOnUtc = foundBook.CreatedOnUtc;
Guid createdBy = foundBook.CreatedBy;
// Copy the editable scalar properties of the book, ignoring the unchanged collection and enrichment columns.
_luminaDbContext.Entry(foundBook).CurrentValues.SetValues(data);
foundBook.LibraryId = libraryId;
foundBook.Path = path;
foundBook.MetadataStatus = metadataStatus;
foundBook.LastMetadataUpdateUtc = lastMetadataUpdateUtc;
foundBook.MetadataProvider = metadataProvider;
foundBook.CreatedOnUtc = createdOnUtc;
foundBook.CreatedBy = createdBy;
// Reuse the stored tags and genres whose names already exist, so that the shared tables are not duplicated.
List<TagEntity> existingTags = await _luminaDbContext.Set<TagEntity>()
.Where(tag => data.Tags.Select(bookTag => bookTag.Name).Contains(tag.Name))
.ToListAsync(cancellationToken).ConfigureAwait(false);
List<GenreEntity> existingGenres = await _luminaDbContext.Set<GenreEntity>()
.Where(genre => data.Genres.Select(bookGenre => bookGenre.Name).Contains(genre.Name))
.ToListAsync(cancellationToken).ConfigureAwait(false);
foundBook.Tags.Clear();
foundBook.Tags.UnionWith(data.Tags.Select(tag => existingTags.FirstOrDefault(existingTag => existingTag.Name == tag.Name) ?? tag));
foundBook.Genres.Clear();
foundBook.Genres.UnionWith(data.Genres.Select(genre => existingGenres.FirstOrDefault(existingGenre => existingGenre.Name == genre.Name) ?? genre));
// Replace the owned collections of the book, so that removed entries are deleted and new entries are inserted.
foundBook.ISBNs.Clear();
foundBook.ISBNs.AddRange(data.ISBNs);
foundBook.Ratings.Clear();
foundBook.Ratings.AddRange(data.Ratings);
foundBook.BookContributors.Clear();
foundBook.BookContributors.AddRange(data.BookContributors);
return Result.Updated;
}
@@ -445,7 +490,7 @@ internal sealed class BookRepository : IBookRepository
Expression titleProperty = Expression.Property(book, nameof(BookEntity.Title));
// the raw title: the title, unless it is null or empty, in which case the original title (or an empty string) is used
// The raw title: the title, unless it is null or empty, in which case the original title (or an empty string) is used.
BinaryExpression isTitleMissing = Expression.OrElse(
Expression.Equal(titleProperty, Expression.Constant(null, typeof(string))),
Expression.Equal(titleProperty, Expression.Constant(string.Empty)));
@@ -455,7 +500,7 @@ internal sealed class BookRepository : IBookRepository
MethodCallExpression lowerTitle = Expression.Call(rawTitle, s_toLowerMethod);
// when ignoring the "The " prefix, strip a leading "the " from the lowercased title
// When ignoring the "The " prefix, strip a leading "the " from the lowercased title.
Expression effectiveTitle = lowerTitle;
if (shouldIgnoreThePrefixForAlphaPicker)
{
@@ -476,11 +521,11 @@ internal sealed class BookRepository : IBookRepository
{
FilterSpecification<BookEntity>? filterSpecification = null;
// include the search term filter, if provided
// Include the search term filter, if provided.
if (!string.IsNullOrWhiteSpace(libraryFilter.SearchTerm))
filterSpecification = new BookSearchSpecification(libraryFilter.SearchTerm);
// include the alpha key filter, if provided
// Include the alpha key filter, if provided.
if (libraryFilter.FilterAlphaKey is not null)
{
BookAlphaFilterSpecification alphaFilterSpecification = new(libraryFilter.FilterAlphaKey, libraryFilter.ShouldIgnoreThePrefixForAlphaPicker);
@@ -37,6 +37,8 @@ public static partial class Errors
public static Error VolumeNumberMustBeGreaterThanZero => Error.Validation(description: nameof(VolumeNumberMustBeGreaterThanZero));
public static Error BookLibraryCannotBeNull => Error.Validation(description: nameof(BookLibraryCannotBeNull));
public static Error BookPathCannotBeEmpty => Error.Validation(description: nameof(BookPathCannotBeEmpty));
public static Error BookIdCannotBeEmpty => Error.Validation(description: nameof(BookIdCannotBeEmpty));
public static Error BookCoverCannotBeNull => Error.Validation(description: nameof(BookCoverCannotBeNull));
public static Error BookNotFound => Error.NotFound(description: nameof(BookNotFound));
}
}
@@ -60,7 +60,7 @@ internal sealed class BookArtworkService : IBookArtworkService
/// <returns>An <see cref="Result{TValue}"/> containing either the relative path of the stored artwork, or an error.</returns>
public async Task<Result<string>> SaveBookArtworkAsync(Guid libraryId, Guid bookId, string libraryName, string authorName, string bookTitle, ArtworkDto artwork, CancellationToken cancellationToken)
{
// resolve the local file path of the artwork, downloading it to a temporary file when it is remote
// Resolve the local file path of the artwork, downloading it to a temporary file when it is remote.
Result<ArtworkSourceResult> resolveSourceResult = await ResolveArtworkSourceAsync(artwork, cancellationToken).ConfigureAwait(false);
if (resolveSourceResult.IsFailure)
return resolveSourceResult.Errors;
@@ -75,7 +75,7 @@ internal sealed class BookArtworkService : IBookArtworkService
}
finally
{
// remove the temporary file downloaded for the remote artwork, never a local file of the user
// Remove the temporary file downloaded for the remote artwork, never a local file of the user.
if (resolveSourceResult.Value.IsTemporary && File.Exists(sourcePath))
{
try
@@ -84,11 +84,79 @@ internal sealed class BookArtworkService : IBookArtworkService
}
catch (IOException)
{
// a failed cleanup of the temporary file must not mask the result of the operation
// A failed cleanup of the temporary file must not mask the result of the operation.
}
catch (UnauthorizedAccessException)
{
// a failed cleanup of the temporary file must not mask the result of the operation
// A failed cleanup of the temporary file must not mask the result of the operation.
}
}
}
}
/// <summary>
/// Stores the artwork uploaded in the <paramref name="artworkStream"/> of the book into the internal media directory, and returns the relative path of the stored artwork.
/// </summary>
/// <param name="libraryId">The Id of the media library the book belongs to.</param>
/// <param name="bookId">The Id of the book.</param>
/// <param name="libraryName">The name of the media library the book belongs to.</param>
/// <param name="authorName">The name of the author of the book.</param>
/// <param name="bookTitle">The title of the book.</param>
/// <param name="artworkStream">The stream of the uploaded artwork file.</param>
/// <param name="fileName">The name of the uploaded artwork file.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either the relative path of the stored artwork, or an error.</returns>
public async Task<Result<string>> SaveBookArtworkAsync(Guid libraryId, Guid bookId, string libraryName, string authorName, string bookTitle, Stream artworkStream, string fileName, CancellationToken cancellationToken)
{
if (artworkStream is null || artworkStream.Length == 0)
return Errors.FileSystemManagement.FileNotFound;
if (artworkStream.Length > MAX_ARTWORK_SIZE_BYTES)
return Errors.FileSystemManagement.FileTooLarge;
// Copy the uploaded artwork into a temporary file, so that the shared artwork storage can validate and copy it.
string temporaryPath = Path.Combine(Path.GetTempPath(), $"lumina-artwork-{Guid.NewGuid():N}{Path.GetExtension(fileName)}");
bool written = false;
try
{
await using (FileStream fileStream = new(temporaryPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, bufferSize: 81920, useAsync: true))
await artworkStream.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
written = true;
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception)
{
return Errors.FileSystemManagement.FileNotFound;
}
finally
{
// Remove the partially written temporary file when the upload failed.
if (!written && File.Exists(temporaryPath))
File.Delete(temporaryPath);
}
try
{
return await StoreArtworkAsync(libraryId, bookId, libraryName, authorName, bookTitle, temporaryPath, cancellationToken).ConfigureAwait(false);
}
finally
{
// Remove the temporary file after the artwork has been stored.
if (File.Exists(temporaryPath))
{
try
{
File.Delete(temporaryPath);
}
catch (IOException)
{
// A failed cleanup of the temporary file must not mask the result of the operation.
}
catch (UnauthorizedAccessException)
{
// A failed cleanup of the temporary file must not mask the result of the operation.
}
}
}
@@ -135,16 +203,16 @@ internal sealed class BookArtworkService : IBookArtworkService
if (!fileExistsResult.Value)
return Errors.FileSystemManagement.FileNotFound;
// reject the artwork when it is a symbolic link or a reparse point, which could point to any file of the machine
// Reject the artwork when it is a symbolic link or a reparse point, which could point to any file of the machine.
if (File.GetAttributes(sourcePath).HasFlag(FileAttributes.ReparsePoint))
return Errors.FileSystemManagement.InvalidPath;
// reject the artwork when it exceeds the maximum allowed size
// Reject the artwork when it exceeds the maximum allowed size.
FileInfo sourceFileInfo = new(sourcePath);
if (sourceFileInfo.Length > MAX_ARTWORK_SIZE_BYTES)
return Errors.FileSystemManagement.FileTooLarge;
// make sure the file is an actual supported image
// Make sure the file is an actual supported image.
Result<ImageType> imageTypeResult = await _environmentContext.FileTypeService.GetImageTypeAsync(sourcePathIdResult.Value, cancellationToken).ConfigureAwait(false);
if (imageTypeResult.IsFailure)
return imageTypeResult.Errors;
@@ -159,24 +227,24 @@ internal sealed class BookArtworkService : IBookArtworkService
if (ensureDirectoryResult.IsFailure)
return ensureDirectoryResult.Errors;
// delete the previous cover of the book, so that a changed artwork does not leave orphaned files behind
// Delete the previous cover of the book, so that a changed artwork does not leave orphaned files behind.
DeleteCover(artworkDirectoryPathResult.Value);
Result<FileSystemPathId> artworkDirectoryPathIdResult = FileSystemPathId.Create(artworkDirectoryPathResult.Value);
if (artworkDirectoryPathIdResult.IsFailure)
return artworkDirectoryPathIdResult.Errors;
// copy the artwork file from the source location
// Copy the artwork file from the source location.
Result<FileSystemPathId> copyFileResult = _environmentContext.FileProviderService.CopyFile(sourcePathIdResult.Value, artworkDirectoryPathIdResult.Value, true);
if (copyFileResult.IsFailure)
return copyFileResult.Errors;
// rename the copied file to the standard naming
// Rename the copied file to the standard naming.
Result<FileSystemPathId> renameFileResult = _environmentContext.FileProviderService.RenameFile(copyFileResult.Value, $"cover.{imageTypeResult.Value.ToString().ToLowerInvariant()}");
if (renameFileResult.IsFailure)
return renameFileResult.Errors;
// get the internal relative path for the copied file
// Get the internal relative path for the copied file.
string relativePath = renameFileResult.Value.Path[AppContext.BaseDirectory.Length..];
if (!relativePath.StartsWith(_pathService.PathSeparator))
relativePath = $"{_pathService.PathSeparator}{relativePath}";
@@ -197,7 +265,7 @@ internal sealed class BookArtworkService : IBookArtworkService
if (string.IsNullOrWhiteSpace(artwork.RemoteUrl))
return Errors.FileSystemManagement.FileNotFound;
// download the remote artwork into a temporary file, aborting when it exceeds the maximum allowed size
// Download the remote artwork into a temporary file, aborting when it exceeds the maximum allowed size.
using HttpClient httpClient = _httpClientFactory.CreateClient();
string tempPath = Path.Combine(Path.GetTempPath(), $"lumina-artwork-{Guid.NewGuid():N}");
bool downloaded = false;
@@ -233,7 +301,7 @@ internal sealed class BookArtworkService : IBookArtworkService
}
finally
{
// remove the partially downloaded temporary file when the download failed
// Remove the partially downloaded temporary file when the download failed.
if (!downloaded && File.Exists(tempPath))
File.Delete(tempPath);
}
@@ -14,6 +14,8 @@ public static partial class ApiRoutes
public const string GET_BOOKS = "/books";
public const string GET_BOOKS_LITE = "/books/lite";
public const string ADD_BOOK = "/books";
public const string UPDATE_BOOK = "/books/{id}";
public const string UPDATE_BOOK_COVER = "/books/{id}/cover";
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}";
@@ -88,7 +88,7 @@ public class GetThumbnailEndpointSummary : Summary<GetThumbnailEndpoint, GetThum
"General.Validation", new[]
{
"PathCannotBeEmpty",
"ImageQaulityMustBeBetweenZeroAndOneHundred"
"ImageQualityMustBeBetweenZeroAndOneHundred"
}
}
},
@@ -123,12 +123,12 @@ public class AddLibraryEndpointSummary : Summary<AddLibraryEndpoint, AddLibraryR
{
"General.Validation", new[]
{
"UserIdCannotBeEmpty",
"LibraryTypeCannotBeNull",
"UnknownLibraryType",
"PathsListCannotBeNull",
"PathsListCannotBeEmpty",
"PathCannotBeEmpty",
"PathMustBeMaximum260CharactersLong",
"TitleCannotBeEmpty",
"TitleMustBeMaximum255CharactersLong",
"CoverFileMustBeAnImage"
@@ -128,7 +128,6 @@ public class GetLibraryEndpointSummary : Summary<GetLibraryEndpoint, GetLibraryR
{
"General.Validation", new[]
{
"UserIdCannotBeEmpty",
"LibraryIdCannotBeEmpty"
}
}
@@ -151,13 +151,14 @@ public class UpdateLibraryEndpointSummary : Summary<UpdateLibraryEndpoint, Updat
{
"General.Validation", new[]
{
"LibraryIdCannotBeEmpty",
"UserIdCannotBeEmpty",
"LibraryTypeCannotBeNull",
"LibraryTypeCannotBeNull",
"UnknownLibraryType",
"PathsListCannotBeNull",
"PathsListCannotBeEmpty",
"PathCannotBeEmpty",
"PathMustBeMaximum260CharactersLong",
"TitleCannotBeEmpty",
"TitleMustBeMaximum255CharactersLong"
}
@@ -18,12 +18,12 @@ namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.B
/// Class used for providing a textual description for the <see cref="AddBookEndpoint"/> API endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest>
public class AddBookEndpointSummary : Summary<AddBookEndpoint, AddBookRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="AddLibraryEndpointSummary"/> class.
/// Initializes a new instance of the <see cref="AddBookEndpointSummary"/> class.
/// </summary>
public AddLibraryEndpointSummary()
public AddBookEndpointSummary()
{
Summary = "Adds a new book.";
Description = "Creates a new book and returns its details, including the location of the newly created resource.";
@@ -130,6 +130,8 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
]
);
RequestParam(r => r.LibraryId, "The Id of the media library this book belongs to. Required.");
RequestParam(r => r.Path, "The file system path of the book. Required.");
RequestParam(r => r.Metadata, "Written content metadata of the book. Required.");
RequestParam(r => r.Metadata!.Title, "The title of the written content. Required.");
RequestParam(r => r.Metadata!.OriginalTitle, "The original title of the written content, if different from the current title. Optional.");
@@ -171,13 +173,55 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
RequestParam(r => r.Contributors, "The list of media contributors (actors, directors, etc) starring in this book. Required.");
RequestParam(r => r.Ratings, "The list of ratings for this book. Required.");
ResponseParam<BookResponse>(r => r.Id, "The unique identifier of the entity.");
ResponseParam<BookResponse>(r => r.CreatedOnUtc, "The date and time when the entity was created.");
ResponseParam<BookResponse>(r => r.UpdatedOnUtc, "The date and time when the entity was last updated.");
ResponseParam<BookResponse>(r => r.Id, "The unique identifier of the book.");
ResponseParam<BookResponse>(r => r.LibraryId, "The Id of the media library the book belongs to.");
ResponseParam<BookResponse>(r => r.Path, "The file system path of the book.");
ResponseParam<BookResponse>(r => r.Metadata, "The written content metadata of the book.");
ResponseParam<BookResponse>(r => r.Metadata.Title, "The title of the media item.");
ResponseParam<BookResponse>(r => r.Metadata.OriginalTitle, "The original title of the media item.");
// TODO: continue response params
ResponseParam<BookResponse>(r => r.Metadata!.Title, "The title of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalTitle, "The original title of the book, if different from the current title.");
ResponseParam<BookResponse>(r => r.Metadata!.Description, "A brief description or summary of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo, "The release information of the book, including its release date and other relevant details.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseDate, "The original release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseYear, "The original release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseDate, "The re-release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseYear, "The re-release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseCountry, "The country where the book was released.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseVersion, "The version or edition of the release of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Genres, "The list of genres of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Tags, "The list of tags of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language, "The language in which the book is written.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageCode, "The ISO code of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageName, "The name of the language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.NativeName, "The native name of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage, "The original language of the book, if it has been translated.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageCode, "The ISO code of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageName, "The name of the original language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.NativeName, "The native name of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Publisher, "The publisher of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.PageCount, "The number of pages of the book.");
ResponseParam<BookResponse>(r => r.Format, "The format of the book (e.g., Hardcover, Paperback), if applicable.");
ResponseParam<BookResponse>(r => r.Edition, "The edition of the book, if applicable.");
ResponseParam<BookResponse>(r => r.VolumeNumber, "The volume or book number in the series, if applicable.");
ResponseParam<BookResponse>(r => r.Series, "The series the book is part of, if applicable.");
ResponseParam<BookResponse>(r => r.Series!.Title, "The title of the series the book is part of.");
ResponseParam<BookResponse>(r => r.ASIN, "The ASIN (Amazon Standard Identification Number) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoodreadsId, "The Goodreads ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LCCN, "The Library of Congress Control Number (LCCN) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OCLCNumber, "The OCLC Number (WorldCat identifier) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OpenLibraryId, "The Open Library ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LibraryThingId, "The LibraryThing ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoogleBooksId, "The Google Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.BarnesAndNobleId, "The Barnes & Noble ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.AppleBooksId, "The Apple Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.ISBNs, "The list of ISBN (International Standard Book Number) of the book.");
ResponseParam<BookResponse>(r => r.Contributors, "The list of media contributors starring in this book.");
ResponseParam<BookResponse>(r => r.Ratings, "The list of ratings for the book.");
ResponseParam<BookResponse>(r => r.MetadataStatus, "The status of the metadata enrichment of the book.");
ResponseParam<BookResponse>(r => r.LastMetadataUpdateUtc, "The date and time when the metadata of the book was last enriched, if applicable.");
ResponseParam<BookResponse>(r => r.MetadataProvider, "The name of the plugin that enriched the metadata of the book, if applicable.");
ResponseParam<BookResponse>(r => r.CreatedOnUtc, "The date and time when the book was created.");
ResponseParam<BookResponse>(r => r.UpdatedOnUtc, "The date and time when the book was last updated, if applicable.");
ResponseParam<BookResponse>(r => r.CoverPath, "The path of the cover image of the book, if available.");
Response(201, "The new book is returned.", example:
new BookResponse(
@@ -196,16 +240,18 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
ReleaseCountry: "uk",
ReleaseVersion: "50th Anniversary Edition"
),
Genres: new List<GenreDto>() {
{ new(Name: "fantasy") },
{ new(Name: "adventure") },
{ new(Name: "classic") }
},
Tags: new List<TagDto>() {
{ new(Name: "epic fantasy") },
{ new(Name: "quest") },
{ new(Name: "middle-earth") }
},
Genres:
[
new(Name: "fantasy"),
new(Name: "adventure"),
new(Name: "classic")
],
Tags:
[
new(Name: "epic fantasy"),
new(Name: "quest"),
new(Name: "middle-earth")
],
Language: new(
LanguageCode: "en",
LanguageName: "English",
@@ -321,6 +367,18 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
}
);
Response(403, "The request failed because the user making the request is not an Admin, or the owner of the media library.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.4",
title = "General.Unauthorized",
status = 403,
detail = "NotAuthorized",
instance = "/api/v1/books",
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
}
);
Response(422, "The request did not pass validation checks.", "application/problem+json",
example: new
{
@@ -334,6 +392,9 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
{
"General.Validation", new[]
{
"BookLibraryCannotBeNull",
"BookPathCannotBeEmpty",
"MetadataCannotBeNull",
"TitleCannotBeEmpty",
"TitleMustBeMaximum255CharactersLong",
"OriginalTitleMustBeMaximum255CharactersLong",
@@ -347,7 +408,6 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
"ReReleaseDateAndYearMustMatch",
"ReReleaseYearCannotBeEarlierThanOriginalReleaseYear",
"ReReleaseDateCannotBeEarlierThanOriginalReleaseDate",
"ReReleaseDateAndYearMustMatch",
"GenresListCannotBeNull",
"GenreNameCannotBeEmpty",
"GenreNameMustBeMaximum50CharactersLong",
@@ -360,13 +420,10 @@ public class AddLibraryEndpointSummary : Summary<AddBookEndpoint, AddBookRequest
"LanguageNameMustBeMaximum50CharactersLong",
"LanguageNativeNameMustBeMaximum50CharactersLong",
"PublisherMustBeMaximum100CharactersLong",
"UnknownBookFormat",
"PageCountMustBeGreaterThanZero",
"UnknownBookFormat",
"EditionMustBeMaximum50CharactersLong",
"VolumeNumberMustBeGreaterThanZero",
"TitleCannotBeEmpty",
"TitleMustBeMaximum255CharactersLong",
"AsinMustBe10CharactersLong",
"GoodreadsIdMustBeNumeric",
"InvalidLccnFormat",
@@ -1,5 +1,10 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.Common.Primitives;
using Lumina.Presentation.Api.Common.Routes.Library.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Api.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
@@ -14,6 +19,17 @@ namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.B
/// </summary>
public class GetBookEndpoint : BaseEndpoint<GetBookRequest, IResult>
{
private readonly IQueryHandler<GetBookQuery, Result<BookResponse>> _getBookQueryHandler;
/// <summary>
/// Initializes a new instance of the <see cref="GetBookEndpoint"/> class.
/// </summary>
/// <param name="getBookQueryHandler">Injected service for handling get book queries.</param>
public GetBookEndpoint(IQueryHandler<GetBookQuery, Result<BookResponse>> getBookQueryHandler)
{
_getBookQueryHandler = getBookQueryHandler;
}
/// <summary>
/// Configures the API endpoint.
/// </summary>
@@ -22,19 +38,17 @@ public class GetBookEndpoint : BaseEndpoint<GetBookRequest, IResult>
Verbs(FastEndpoints.Http.GET);
Routes(ApiRoutes.Books.GET_BOOK_BY_ID);
Version(1);
AllowAnonymous();
DontCatchExceptions();
}
/// <summary>
/// Adds a book stored in <paramref name="request"/>.
/// Gets the book identified by <paramref name="request"/>.
/// </summary>
/// <param name="request">The request containing the book to be added.</param>
/// <param name="request">The request containing the Id of the book to get.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookRequest request, CancellationToken cancellationToken)
{
//Result<Book> result = await _sender.Send(request.ToCommand(), cancellationToken).ConfigureAwait(false);
//return result.Match(success => TypedResults.CreatedAtRoute($"/api/v1/books/{success.Id}", success), Problem);
return await Task.FromResult(TypedResults.Ok());
Result<BookResponse> result = await _getBookQueryHandler.HandleAsync(request.ToQuery(), cancellationToken).ConfigureAwait(false);
return result.Match(success => TypedResults.Ok(success), Problem);
}
}
@@ -0,0 +1,259 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetBook;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetBookEndpoint"/> API endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetBookEndpointSummary : Summary<GetBookEndpoint, GetBookRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetBookEndpointSummary"/> class.
/// </summary>
public GetBookEndpointSummary()
{
Summary = "Gets a book by its Id.";
Description = "Gets the full details of the book identified by the request, including the resolved names of its media contributors.";
ExampleRequest = new GetBookRequest(
Id: Guid.NewGuid().ToString()
);
RequestParam(r => r.Id, "The Id of the book to get. Required.");
ResponseParam<BookResponse>(r => r.Id, "The Id of the book.");
ResponseParam<BookResponse>(r => r.LibraryId, "The Id of the media library the book belongs to.");
ResponseParam<BookResponse>(r => r.Path, "The file system path of the book.");
ResponseParam<BookResponse>(r => r.Metadata, "The written content metadata of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Title, "The title of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalTitle, "The original title of the book, if different from the current title.");
ResponseParam<BookResponse>(r => r.Metadata!.Description, "A brief description or summary of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo, "The release information of the book, including its release date and other relevant details.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseDate, "The original release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseYear, "The original release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseDate, "The re-release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseYear, "The re-release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseCountry, "The country where the book was released.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseVersion, "The version or edition of the release of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Genres, "The list of genres of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Tags, "The list of tags of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language, "The language in which the book is written.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageCode, "The ISO code of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageName, "The name of the language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.NativeName, "The native name of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage, "The original language of the book, if it has been translated.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageCode, "The ISO code of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageName, "The name of the original language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.NativeName, "The native name of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Publisher, "The publisher of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.PageCount, "The number of pages of the book.");
ResponseParam<BookResponse>(r => r.Format, "The format of the book (e.g., Hardcover, Paperback), if applicable.");
ResponseParam<BookResponse>(r => r.Edition, "The edition of the book, if applicable.");
ResponseParam<BookResponse>(r => r.VolumeNumber, "The volume or book number in the series, if applicable.");
ResponseParam<BookResponse>(r => r.Series, "The series the book is part of, if applicable.");
ResponseParam<BookResponse>(r => r.Series!.Title, "The title of the series the book is part of.");
ResponseParam<BookResponse>(r => r.ASIN, "The ASIN (Amazon Standard Identification Number) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoodreadsId, "The Goodreads ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LCCN, "The Library of Congress Control Number (LCCN) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OCLCNumber, "The OCLC Number (WorldCat identifier) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OpenLibraryId, "The Open Library ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LibraryThingId, "The LibraryThing ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoogleBooksId, "The Google Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.BarnesAndNobleId, "The Barnes & Noble ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.AppleBooksId, "The Apple Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.ISBNs, "The list of ISBN (International Standard Book Number) of the book.");
ResponseParam<BookResponse>(r => r.Contributors, "The list of media contributors starring in this book.");
ResponseParam<BookResponse>(r => r.Ratings, "The list of ratings for the book.");
ResponseParam<BookResponse>(r => r.MetadataStatus, "The status of the metadata enrichment of the book.");
ResponseParam<BookResponse>(r => r.LastMetadataUpdateUtc, "The date and time when the metadata of the book was last enriched, if applicable.");
ResponseParam<BookResponse>(r => r.MetadataProvider, "The name of the plugin that enriched the metadata of the book, if applicable.");
ResponseParam<BookResponse>(r => r.CreatedOnUtc, "The date and time when the book was created.");
ResponseParam<BookResponse>(r => r.UpdatedOnUtc, "The date and time when the book was last updated, if applicable.");
ResponseParam<BookResponse>(r => r.CoverPath, "The path of the cover image of the book, if available.");
Response(200, "The requested book is returned.",
example: new BookResponse(
Id: Guid.NewGuid(),
LibraryId: Guid.NewGuid(),
Path: "/books/the-fellowship-of-the-ring.epub",
Metadata: new WrittenContentMetadataDto(
Title: "The Fellowship of the Ring",
OriginalTitle: "The Fellowship of the Ring",
Description: "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
ReleaseInfo: new ReleaseInfoDto(
OriginalReleaseDate: DateOnly.ParseExact("1954-07-29", "yyyy-MM-dd", null),
OriginalReleaseYear: 1954,
ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null),
ReReleaseYear: 2001,
ReleaseCountry: "uk",
ReleaseVersion: "50th Anniversary Edition"
),
Genres:
[
new(Name: "fantasy"),
new(Name: "adventure"),
new(Name: "classic")
],
Tags:
[
new(Name: "epic fantasy"),
new(Name: "quest"),
new(Name: "middle-earth")
],
Language: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
OriginalLanguage: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
Publisher: "Houghton Mifflin",
PageCount: 398
),
Format: BookFormat.Paperback,
Edition: "50th Anniversary Edition",
VolumeNumber: 1,
Series: new BookSeriesDto(
Title: "The Lord of the Rings"
),
ASIN: "B007978NPG",
GoodreadsId: "3",
LCCN: "54009621",
OCLCNumber: "ocm00012345",
OpenLibraryId: "OL7603910M",
LibraryThingId: "3203347",
GoogleBooksId: "aWZzLPhY4o0C",
BarnesAndNobleId: "1100307790",
AppleBooksId: "id395211",
ISBNs:
[
new IsbnDto(
Value: "0395272238",
Format: IsbnFormat.Isbn10
),
new IsbnDto(
Value: "9780395272237",
Format: IsbnFormat.Isbn13
)
],
Contributors:
[
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "J.R.R. Tolkien",
LegalName: "John Ronald Reuel Tolkien"
),
Role: new MediaContributorRoleDto(
Name: "author",
Category: MediaContributorRoleCategory.Author
)
),
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "Alan Lee",
LegalName: "Alan Lee"
),
Role: new MediaContributorRoleDto(
Name: "illustrator",
Category: MediaContributorRoleCategory.Illustrator
)
)
],
Ratings:
[
new BookRatingDto(
Source: BookRatingSource.GoogleBooks,
Value: 4.36M,
MaxValue: 5,
VoteCount: 2345678
),
new BookRatingDto(
Source: BookRatingSource.Amazon,
Value: 4.7M,
MaxValue: 5,
VoteCount: 87654
)
],
MetadataStatus: MetadataStatus.Enriched,
LastMetadataUpdateUtc: DateTime.UtcNow,
MetadataProvider: "GoogleBooks",
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: DateTime.UtcNow,
CoverPath: "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
)
);
Response(401, "Authentication required.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
status = 401,
title = "Unauthorized",
detail = "You are not authorized",
instance = "/api/v1/books/{id}"
}
);
Response(403, "The request failed because the user making the request is not an Admin, or the owner of the media library.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.4",
title = "General.Unauthorized",
status = 403,
detail = "NotAuthorized",
instance = "/api/v1/books/{id}",
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
}
);
Response(404, "The request failed because the book does not exist.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.5",
title = "General.NotFound",
status = 404,
detail = "BookNotFound",
instance = "/api/v1/books/{id}",
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
}
);
Response(422, "The request did not pass validation checks.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc4918#section-11.2",
title = "General.Validation",
status = 422,
detail = "OneOrMoreValidationErrorsOccurred",
instance = "/api/v1/books/{id}",
errors = new Dictionary<string, string[]>
{
{
"General.Validation", new[]
{
"BookIdCannotBeEmpty"
}
}
},
traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00"
}
);
}
}
@@ -112,7 +112,8 @@ public class GetBooksLiteEndpointSummary : Summary<GetBooksLiteEndpoint, GetBook
{
"General.Validation", new[]
{
"LibraryIdCannotBeEmpty"
"LibraryIdCannotBeEmpty",
"InvalidFilterAlphaKey"
}
}
},
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBook;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.Common.Primitives;
using Lumina.Presentation.Api.Common.Routes.Library.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Api.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBook;
/// <summary>
/// API endpoint for the <c>/books/{id}</c> route.
/// </summary>
public class UpdateBookEndpoint : BaseEndpoint<UpdateBookRequest, IResult>
{
private readonly ICommandHandler<UpdateBookCommand, Result<BookResponse>> _updateBookCommandHandler;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookEndpoint"/> class.
/// </summary>
/// <param name="updateBookCommandHandler">Injected service for handling update book commands.</param>
public UpdateBookEndpoint(ICommandHandler<UpdateBookCommand, Result<BookResponse>> updateBookCommandHandler)
{
_updateBookCommandHandler = updateBookCommandHandler;
}
/// <summary>
/// Configures the API endpoint.
/// </summary>
public override void Configure()
{
Verbs(FastEndpoints.Http.PUT);
Routes(ApiRoutes.Books.UPDATE_BOOK);
Version(1);
DontCatchExceptions();
}
/// <summary>
/// Updates the book described in <paramref name="request"/>.
/// </summary>
/// <param name="request">The request containing the edited details of the book.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(UpdateBookRequest request, CancellationToken cancellationToken)
{
// The book is identified by the {id} route value, not by the id of the request body, so that a mismatched or malicious id can never
// redirect the update to another book; the raw value is kept as a string, so that an unparseable id reaches the command validator,
// which reports it with a ProblemDetails validation error instead of failing the request binding.
request = request with { Id = HttpContext.Request.RouteValues["id"]?.ToString() };
Result<BookResponse> result = await _updateBookCommandHandler.HandleAsync(request.ToCommand(), cancellationToken).ConfigureAwait(false);
return result.Match(success => TypedResults.Ok(success), Problem);
}
}
@@ -0,0 +1,460 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary;
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBook;
/// <summary>
/// Class used for providing a textual description for the <see cref="UpdateBookEndpoint"/> API endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class UpdateBookEndpointSummary : Summary<UpdateBookEndpoint, UpdateBookRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookEndpointSummary"/> class.
/// </summary>
public UpdateBookEndpointSummary()
{
Summary = "Updates a book.";
Description = "Updates the details of the book identified by the request.";
RequestParam(r => r.Id, "The Id of the book to update. Required.");
RequestParam(r => r.Metadata, "The written content metadata of the book. Required.");
RequestParam(r => r.Metadata!.Title, "The title of the book. Required.");
RequestParam(r => r.Metadata!.OriginalTitle, "The original title of the book, if different from the current title. Optional.");
RequestParam(r => r.Metadata!.Description, "A brief description or summary of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo, "The release information, including release date and other relevant details. Required.");
RequestParam(r => r.Metadata!.ReleaseInfo!.OriginalReleaseDate, "The original release date of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.OriginalReleaseYear, "The original release year of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReReleaseDate, "The re-release date of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReReleaseYear, "The re-release year of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReleaseCountry, "The country where the book was released. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReleaseVersion, "The version or edition of the release of the book. Optional.");
RequestParam(r => r.Metadata!.Genres, "The list of genres of the book. Required.");
RequestParam(r => r.Metadata!.Tags, "The list of tags of the book. Required.");
RequestParam(r => r.Metadata!.Language, "The language in which the book is written. Optional.");
RequestParam(r => r.Metadata!.Language!.LanguageCode, "The ISO code of the language of the book. Optional.");
RequestParam(r => r.Metadata!.Language!.LanguageName, "The name of the language of the book in English. Optional.");
RequestParam(r => r.Metadata!.Language!.NativeName, "The native name of the language of the book. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage, "The original language of the book, if it has been translated. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.LanguageCode, "The ISO code of the original language of the book. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.LanguageName, "The name of the original language of the book in English. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.NativeName, "The native name of the original language of the book. Optional.");
RequestParam(r => r.Metadata!.Publisher, "The publisher of the book. Optional.");
RequestParam(r => r.Metadata!.PageCount, "The number of pages of the book. Optional.");
RequestParam(r => r.Format, "The format of the book (e.g., Hardcover, Paperback). Optional.");
RequestParam(r => r.Edition, "The edition of the book. Optional.");
RequestParam(r => r.VolumeNumber, "The volume or book number in the series. Optional.");
RequestParam(r => r.Series, "The series the book is part of. Optional.");
RequestParam(r => r.Series!.Title, "The title of the series the book is part of. Optional.");
RequestParam(r => r.ASIN, "The ASIN (Amazon Standard Identification Number) of the book. Optional.");
RequestParam(r => r.GoodreadsId, "The Goodreads Id of the book. Optional.");
RequestParam(r => r.LCCN, "The Library of Congress Control Number (LCCN) of the book. Optional.");
RequestParam(r => r.OCLCNumber, "The OCLC Number (WorldCat identifier) of the book. Optional.");
RequestParam(r => r.OpenLibraryId, "The Open Library Id of the book. Optional.");
RequestParam(r => r.LibraryThingId, "The LibraryThing Id of the book. Optional.");
RequestParam(r => r.GoogleBooksId, "The Google Books Id of the book. Optional.");
RequestParam(r => r.BarnesAndNobleId, "The Barnes & Noble Id of the book. Optional.");
RequestParam(r => r.AppleBooksId, "The Apple Books Id of the book. Optional.");
RequestParam(r => r.ISBNs, "The list of ISBN (International Standard Book Number) of the book. Required.");
RequestParam(r => r.Contributors, "The list of media contributors of the book. Required.");
RequestParam(r => r.Ratings, "The list of ratings of the book. Required.");
ExampleRequest = new UpdateBookRequest(
Id: Guid.NewGuid().ToString(),
Metadata: new WrittenContentMetadataDto(
Title: "The Fellowship of the Ring",
OriginalTitle: "The Fellowship of the Ring",
Description: "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
ReleaseInfo: new ReleaseInfoDto(
OriginalReleaseDate: DateOnly.ParseExact("1954-07-29", "yyyy-MM-dd", null),
OriginalReleaseYear: 1954,
ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null),
ReReleaseYear: 2001,
ReleaseCountry: "uk",
ReleaseVersion: "50th Anniversary Edition"
),
Genres:
[
new(Name: "fantasy"),
new(Name: "adventure"),
new(Name: "classic")
],
Tags:
[
new(Name: "epic fantasy"),
new(Name: "quest"),
new(Name: "middle-earth")
],
Language: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
OriginalLanguage: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
Publisher: "Houghton Mifflin",
PageCount: 398
),
Format: BookFormat.Paperback,
Edition: "50th Anniversary Edition",
VolumeNumber: 1,
Series: new BookSeriesDto(
Title: "The Lord of the Rings"
),
ASIN: "B007978NPG",
GoodreadsId: "3",
LCCN: "54009621",
OCLCNumber: "ocm00012345",
OpenLibraryId: "OL7603910M",
LibraryThingId: "3203347",
GoogleBooksId: "aWZzLPhY4o0C",
BarnesAndNobleId: "1100307790",
AppleBooksId: "id395211",
ISBNs:
[
new IsbnDto(
Value: "0395272238",
Format: IsbnFormat.Isbn10
),
new IsbnDto(
Value: "9780395272237",
Format: IsbnFormat.Isbn13
)
],
Contributors:
[
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "J.R.R. Tolkien",
LegalName: "John Ronald Reuel Tolkien"
),
Role: new MediaContributorRoleDto(
Name: "author",
Category: MediaContributorRoleCategory.Author
)
),
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "Alan Lee",
LegalName: "Alan Lee"
),
Role: new MediaContributorRoleDto(
Name: "illustrator",
Category: MediaContributorRoleCategory.Illustrator
)
)
],
Ratings:
[
new BookRatingDto(
Source: BookRatingSource.GoogleBooks,
Value: 4.36M,
MaxValue: 5,
VoteCount: 2345678
),
new BookRatingDto(
Source: BookRatingSource.Amazon,
Value: 4.7M,
MaxValue: 5,
VoteCount: 87654
)
]
);
ResponseParam<BookResponse>(r => r.Id, "The Id of the book.");
ResponseParam<BookResponse>(r => r.LibraryId, "The Id of the media library the book belongs to.");
ResponseParam<BookResponse>(r => r.Path, "The file system path of the book.");
ResponseParam<BookResponse>(r => r.Metadata, "The written content metadata of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Title, "The title of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalTitle, "The original title of the book, if different from the current title.");
ResponseParam<BookResponse>(r => r.Metadata!.Description, "A brief description or summary of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo, "The release information of the book, including its release date and other relevant details.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseDate, "The original release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.OriginalReleaseYear, "The original release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseDate, "The re-release date of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReReleaseYear, "The re-release year of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseCountry, "The country where the book was released.");
ResponseParam<BookResponse>(r => r.Metadata!.ReleaseInfo!.ReleaseVersion, "The version or edition of the release of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Genres, "The list of genres of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Tags, "The list of tags of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language, "The language in which the book is written.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageCode, "The ISO code of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.LanguageName, "The name of the language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.Language!.NativeName, "The native name of the language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage, "The original language of the book, if it has been translated.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageCode, "The ISO code of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.LanguageName, "The name of the original language of the book in English.");
ResponseParam<BookResponse>(r => r.Metadata!.OriginalLanguage!.NativeName, "The native name of the original language of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.Publisher, "The publisher of the book.");
ResponseParam<BookResponse>(r => r.Metadata!.PageCount, "The number of pages of the book.");
ResponseParam<BookResponse>(r => r.Format, "The format of the book (e.g., Hardcover, Paperback), if applicable.");
ResponseParam<BookResponse>(r => r.Edition, "The edition of the book, if applicable.");
ResponseParam<BookResponse>(r => r.VolumeNumber, "The volume or book number in the series, if applicable.");
ResponseParam<BookResponse>(r => r.Series, "The series the book is part of, if applicable.");
ResponseParam<BookResponse>(r => r.Series!.Title, "The title of the series the book is part of.");
ResponseParam<BookResponse>(r => r.ASIN, "The ASIN (Amazon Standard Identification Number) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoodreadsId, "The Goodreads ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LCCN, "The Library of Congress Control Number (LCCN) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OCLCNumber, "The OCLC Number (WorldCat identifier) of the book, if applicable.");
ResponseParam<BookResponse>(r => r.OpenLibraryId, "The Open Library ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.LibraryThingId, "The LibraryThing ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.GoogleBooksId, "The Google Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.BarnesAndNobleId, "The Barnes & Noble ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.AppleBooksId, "The Apple Books ID of the book, if applicable.");
ResponseParam<BookResponse>(r => r.ISBNs, "The list of ISBN (International Standard Book Number) of the book.");
ResponseParam<BookResponse>(r => r.Contributors, "The list of media contributors starring in this book.");
ResponseParam<BookResponse>(r => r.Ratings, "The list of ratings for the book.");
ResponseParam<BookResponse>(r => r.MetadataStatus, "The status of the metadata enrichment of the book.");
ResponseParam<BookResponse>(r => r.LastMetadataUpdateUtc, "The date and time when the metadata of the book was last enriched, if applicable.");
ResponseParam<BookResponse>(r => r.MetadataProvider, "The name of the plugin that enriched the metadata of the book, if applicable.");
ResponseParam<BookResponse>(r => r.CreatedOnUtc, "The date and time when the book was created.");
ResponseParam<BookResponse>(r => r.UpdatedOnUtc, "The date and time when the book was last updated, if applicable.");
ResponseParam<BookResponse>(r => r.CoverPath, "The path of the cover image of the book, if available.");
Response(200, "The updated book is returned.",
example: new BookResponse(
Id: Guid.NewGuid(),
LibraryId: Guid.NewGuid(),
Path: "/books/the-fellowship-of-the-ring.epub",
Metadata: new WrittenContentMetadataDto(
Title: "The Fellowship of the Ring",
OriginalTitle: "The Fellowship of the Ring",
Description: "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
ReleaseInfo: new ReleaseInfoDto(
OriginalReleaseDate: DateOnly.ParseExact("1954-07-29", "yyyy-MM-dd", null),
OriginalReleaseYear: 1954,
ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null),
ReReleaseYear: 2001,
ReleaseCountry: "uk",
ReleaseVersion: "50th Anniversary Edition"
),
Genres:
[
new(Name: "fantasy"),
new(Name: "adventure"),
new(Name: "classic")
],
Tags:
[
new(Name: "epic fantasy"),
new(Name: "quest"),
new(Name: "middle-earth")
],
Language: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
OriginalLanguage: new LanguageInfoDto(
LanguageCode: "en",
LanguageName: "English",
NativeName: "English"
),
Publisher: "Houghton Mifflin",
PageCount: 398
),
Format: BookFormat.Paperback,
Edition: "50th Anniversary Edition",
VolumeNumber: 1,
Series: new BookSeriesDto(
Title: "The Lord of the Rings"
),
ASIN: "B007978NPG",
GoodreadsId: "3",
LCCN: "54009621",
OCLCNumber: "ocm00012345",
OpenLibraryId: "OL7603910M",
LibraryThingId: "3203347",
GoogleBooksId: "aWZzLPhY4o0C",
BarnesAndNobleId: "1100307790",
AppleBooksId: "id395211",
ISBNs:
[
new IsbnDto(
Value: "0395272238",
Format: IsbnFormat.Isbn10
),
new IsbnDto(
Value: "9780395272237",
Format: IsbnFormat.Isbn13
)
],
Contributors:
[
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "J.R.R. Tolkien",
LegalName: "John Ronald Reuel Tolkien"
),
Role: new MediaContributorRoleDto(
Name: "author",
Category: MediaContributorRoleCategory.Author
)
),
new MediaContributorDto(
Name: new MediaContributorNameDto(
DisplayName: "Alan Lee",
LegalName: "Alan Lee"
),
Role: new MediaContributorRoleDto(
Name: "illustrator",
Category: MediaContributorRoleCategory.Illustrator
)
)
],
Ratings:
[
new BookRatingDto(
Source: BookRatingSource.GoogleBooks,
Value: 4.36M,
MaxValue: 5,
VoteCount: 2345678
),
new BookRatingDto(
Source: BookRatingSource.Amazon,
Value: 4.7M,
MaxValue: 5,
VoteCount: 87654
)
],
MetadataStatus: MetadataStatus.Enriched,
LastMetadataUpdateUtc: DateTime.UtcNow,
MetadataProvider: "GoogleBooks",
CreatedOnUtc: DateTime.UtcNow,
UpdatedOnUtc: DateTime.UtcNow,
CoverPath: "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
)
);
Response(401, "Authentication required.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
status = 401,
title = "Unauthorized",
detail = "You are not authorized",
instance = "/api/v1/books/{id}"
}
);
Response(403, "The request failed because the user making the request is not an Admin, or the owner of the media library.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.4",
title = "General.Unauthorized",
status = 403,
detail = "NotAuthorized",
instance = "/api/v1/books/{id}",
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
}
);
Response(404, "The request failed because the book or its media library does not exist.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.5",
title = "General.NotFound",
status = 404,
detail = "BookNotFound",
instance = "/api/v1/books/{id}",
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
}
);
Response(422, "The request did not pass validation checks.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc4918#section-11.2",
title = "General.Validation",
status = 422,
detail = "OneOrMoreValidationErrorsOccurred",
instance = "/api/v1/books/{id}",
errors = new Dictionary<string, string[]>
{
{
"General.Validation", new[]
{
"BookIdCannotBeEmpty",
"MetadataCannotBeNull",
"TitleCannotBeEmpty",
"TitleMustBeMaximum255CharactersLong",
"OriginalTitleMustBeMaximum255CharactersLong",
"DescriptionMustBeMaximum2000CharactersLong",
"ReleaseInfoCannotBeNull",
"OriginalReleaseYearMustBeBetween1And9999",
"ReReleaseYearMustBeBetween1And9999",
"CountryCodeMustBe2CharactersLong",
"ReleaseVersionMustBeMaximum50CharactersLong",
"OriginalReleaseDateAndYearMustMatch",
"ReReleaseDateAndYearMustMatch",
"ReReleaseYearCannotBeEarlierThanOriginalReleaseYear",
"ReReleaseDateCannotBeEarlierThanOriginalReleaseDate",
"GenresListCannotBeNull",
"GenreNameCannotBeEmpty",
"GenreNameMustBeMaximum50CharactersLong",
"TagsListCannotBeNull",
"TagNameCannotBeEmpty",
"TagNameMustBeMaximum50CharactersLong",
"LanguageCodeCannotBeEmpty",
"LanguageCodeMustBe2CharactersLong",
"LanguageNameCannotBeEmpty",
"LanguageNameMustBeMaximum50CharactersLong",
"LanguageNativeNameMustBeMaximum50CharactersLong",
"PublisherMustBeMaximum100CharactersLong",
"PageCountMustBeGreaterThanZero",
"UnknownBookFormat",
"EditionMustBeMaximum50CharactersLong",
"VolumeNumberMustBeGreaterThanZero",
"AsinMustBe10CharactersLong",
"GoodreadsIdMustBeNumeric",
"InvalidLccnFormat",
"InvalidOclcFormat",
"InvalidOpenLibraryId",
"LibraryThingIdMustBeMaximum50CharactersLong",
"GoogleBooksIdMustBe12CharactersLong",
"InvalidGoogleBooksIdFormat",
"BarnesAndNoblesIdMustBe10CharactersLong",
"InvalidBarnesAndNoblesIdFormat",
"InvalidAppleBooksIdFormat",
"IsbnListCannotBeNull",
"IsbnValueCannotBeEmpty",
"InvalidIsbn13Format",
"InvalidIsbn10Format",
"UnknownIsbnFormat",
"ContributorsListCannotBeNull",
"ContributorNameCannotBeEmpty",
"ContributorDisplayNameCannotBeEmpty",
"ContributorDisplayNameMustBeMaximum100CharactersLong",
"ContributorLegalNameMustBeMaximum100CharactersLong",
"ContributorRoleCannotBeNull",
"RoleNameCannotBeEmpty",
"RoleNameMustBeMaximum50CharactersLong",
"RoleCategoryCannotBeEmpty",
"RatingsListCannotBeNull",
"RatingValueMustBePositive",
"RatingValueCannotBeGreaterThanMaxValue",
"RatingMaxValueMustBePositive",
"RatingVoteCountMustBePositive"
}
}
},
traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00"
}
);
}
}
@@ -0,0 +1,81 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Commands.UpdateBookCover;
using Lumina.Domain.Common.Primitives;
using Lumina.Presentation.Api.Common.Routes.Library.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Api.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBookCover;
/// <summary>
/// API endpoint for the <c>/books/{id}/cover</c> route.
/// </summary>
public class UpdateBookCoverEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly Application.Common.CQRS.ICommandHandler<UpdateBookCoverCommand, Result<string>> _updateBookCoverCommandHandler;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverEndpoint"/> class.
/// </summary>
/// <param name="updateBookCoverCommandHandler">Injected service for handling update book cover commands.</param>
public UpdateBookCoverEndpoint(Application.Common.CQRS.ICommandHandler<UpdateBookCoverCommand, Result<string>> updateBookCoverCommandHandler)
{
_updateBookCoverCommandHandler = updateBookCoverCommandHandler;
}
/// <summary>
/// Configures the API endpoint.
/// </summary>
public override void Configure()
{
Verbs(Http.PUT);
Routes(ApiRoutes.Books.UPDATE_BOOK_COVER);
Version(1);
DontCatchExceptions();
}
/// <summary>
/// Updates the cover image of the book with the image uploaded in the multipart form of the request.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The endpoint takes no typed request, because its body is a multipart file, so the book id is read from the {id} route
// value; an unparseable value becomes Guid.Empty, which the command validator reports as a missing book id.
Guid bookId = Guid.TryParse(HttpContext.Request.RouteValues["id"]?.ToString(), out Guid parsedBookId) ? parsedBookId : Guid.Empty;
IFormFile? cover = null;
if (HttpContext.Request.HasFormContentType)
{
try
{
// The cover is the first file of the multipart form; a multipart body without any file cannot be parsed as a form,
// so a malformed upload is treated as a missing cover, which the command validator reports.
cover = HttpContext.Request.Form.Files.Count > 0 ? HttpContext.Request.Form.Files[0] : null;
}
catch (InvalidDataException)
{
cover = null;
}
}
// The cover stream must stay open while the handler stores the image, and is disposed as soon as the handler returns.
UpdateBookCoverCommand command = new(bookId, cover?.OpenReadStream(), cover?.FileName);
try
{
Result<string> result = await _updateBookCoverCommandHandler.HandleAsync(command, cancellationToken).ConfigureAwait(false);
return result.Match(success => TypedResults.Ok(success), Problem);
}
finally
{
command.Cover?.Dispose();
}
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBookCover;
/// <summary>
/// Class used for providing a textual description for the <see cref="UpdateBookCoverEndpoint"/> API endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class UpdateBookCoverEndpointSummary : Summary<UpdateBookCoverEndpoint, EmptyRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverEndpointSummary"/> class.
/// </summary>
public UpdateBookCoverEndpointSummary()
{
Summary = "Updates the cover image of a book.";
Description = "Updates the cover image of the book identified by the request, with the image uploaded in the multipart form of the request.";
Response(200, "The relative path of the stored cover image is returned.",
example: "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
);
Response(401, "Authentication required.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
status = 401,
title = "Unauthorized",
detail = "You are not authorized",
instance = "/api/v1/books/{id}/cover"
}
);
Response(403, "The request failed because the user making the request is not an Admin, or the owner of the media library.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.4",
title = "General.Unauthorized",
status = 403,
detail = "NotAuthorized",
instance = "/api/v1/books/{id}/cover",
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
}
);
Response(404, "The request failed because the book or its media library does not exist.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.5",
title = "General.NotFound",
status = 404,
detail = "BookNotFound",
instance = "/api/v1/books/{id}/cover",
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
}
);
Response(422, "The request did not pass validation checks.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc4918#section-11.2",
title = "General.Validation",
status = 422,
detail = "OneOrMoreValidationErrorsOccurred",
instance = "/api/v1/books/{id}/cover",
errors = new Dictionary<string, string[]>
{
{
"General.Validation", new[]
{
"BookIdCannotBeEmpty",
"BookCoverCannotBeNull",
"FileTooLarge",
"CoverFileMustBeAnImage"
}
}
},
traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00"
}
);
}
}
@@ -74,7 +74,7 @@ public class SetupApplicationEndpointSummary : Summary<SetupApplicationEndpoint,
"General.Validation", new[]
{
"UsernameCannotBeEmpty",
"PassordCannotBeEmpty",
"PasswordCannotBeEmpty",
"InvalidPassword",
"PasswordConfirmCannotBeEmpty",
"PasswordsNotMatch"
@@ -99,7 +99,8 @@ public class InstallPluginEndpointSummary : Summary<InstallPluginEndpoint, Empty
{
"General.Validation", new[]
{
"PluginArchiveCannotBeNull"
"PluginArchiveCannotBeNull",
"PluginFileNameCannotBeEmpty"
}
}
},
@@ -77,9 +77,9 @@ public class RegisterEndpointSummary : Summary<RegisterEndpoint, RegistrationReq
"General.Validation", new[]
{
"UsernameCannotBeEmpty",
"PassordCannotBeEmpty",
"UsernameMustBeBetween3And255CharactersLong",
"InvalidUsername",
"PasswordCannotBeEmpty",
"InvalidPassword",
"PasswordConfirmCannotBeEmpty",
"PasswordsNotMatch"
@@ -118,7 +118,6 @@ public class UpdateUserRoleAndPermissionsEndpointSummary : Summary<UpdateUserRol
"General.Validation", new[]
{
"UserIdCannotBeEmpty",
"RoleIdCannotBeEmpty",
"PermissionIdCannotBeEmpty"
}
}
@@ -39,7 +39,7 @@ public class ApiHttpClient : IApiHttpClient
{
_httpClient = httpClient;
_httpContext = httpContextAccessor.HttpContext;
// read the API server configuration values from the configuration, and assign them to the injected client
// Read the API server configuration values from the configuration, and assign them to the injected client.
ServerConfigurationDto serverConfiguration = serverConfigurationOptions.Value;
httpClient.BaseAddress = new Uri($"{serverConfiguration.BaseAddress}:{serverConfiguration.Port}/api/v{serverConfiguration.ApiVersion}/");
@@ -82,11 +82,11 @@ public class ApiHttpClient : IApiHttpClient
AuthenticationHeaderValue? authenticationHeader = GetAuthenticationHeader();
if (authenticationHeader is not null)
request.Headers.Authorization = authenticationHeader;
// send the request and expect only headers initially - this prevents the client from buffering the entire response
// Send the request and expect only headers initially - this prevents the client from buffering the entire response.
using HttpResponseMessage response = await _httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
await using Stream stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
// Deserialize the JSON content asynchronously as an enumerable of TResponse items
// Deserialize the JSON content asynchronously as an enumerable of TResponse items.
await foreach (TResponse? item in JsonSerializer.DeserializeAsyncEnumerable<TResponse>(stream, _jsonOptions, cancellationToken).ConfigureAwait(false))
{
if (cancellationToken.IsCancellationRequested)
@@ -110,17 +110,17 @@ public class ApiHttpClient : IApiHttpClient
using HttpResponseMessage response = await _httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
// read the content as a string, for error messages
// Read the content as a string, for error messages.
string content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
ProblemDetailsDto? problemDetails = null;
try
{
problemDetails = JsonSerializer.Deserialize<ProblemDetailsDto>(content, _jsonOptions);
}
catch { /* if we can't deserialize to ProblemDetails, we'll just use the status code */ }
catch { /* If we can't deserialize to ProblemDetails, we'll just use the status code. */ }
throw new ApiException(problemDetails, response.StatusCode);
}
// if the response is successful, read it as a byte array
// If the response is successful, read it as a byte array.
byte[] responseContent = await response.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false);
string contentType = response.Content.Headers.ContentType?.ToString() ?? "application/octet-stream";
return new BlobDataDto { Data = responseContent, ContentType = contentType };
@@ -137,19 +137,18 @@ public class ApiHttpClient : IApiHttpClient
AuthenticationHeaderValue? authenticationHeader = GetAuthenticationHeader();
if (authenticationHeader is not null)
request.Headers.Authorization = authenticationHeader;
//return await SendRequestAsync<TResponse>(request, cancellationToken).ConfigureAwait(false);
// send the HTTP request and read the response
// Send the HTTP request and read the response.
HttpResponseMessage response = await _httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
ProblemDetailsDto? problemDetails = null;
string content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
// attempt to deserialize the response content to ProblemDetailsDto if the request fails
// Attempt to deserialize the response content to ProblemDetailsDto if the request fails.
try
{
problemDetails = JsonSerializer.Deserialize<ProblemDetailsDto>(content, _jsonOptions);
}
catch { /* if we can't deserialize to ProblemDetails, we'll just use the status code */ }
catch { /* If we can't deserialize to ProblemDetails, we'll just use the status code. */ }
throw new ApiException(problemDetails, response.StatusCode, request.RequestUri?.AbsolutePath);
}
}
@@ -204,7 +203,7 @@ public class ApiHttpClient : IApiHttpClient
/// <returns>The deserialized response containing the result of the POST request.</returns>
public async Task<TResponse> PostMultipartAsync<TResponse>(string endpoint, Stream fileStream, string fileName, string fieldName, CancellationToken cancellationToken = default)
{
// the file is streamed as a generic binary part, since the exact content type of the uploaded file is not known
// The file is streamed as a generic binary part, since the exact content type of the uploaded file is not known.
using MultipartFormDataContent form = [];
using StreamContent fileContent = new(fileStream);
fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
@@ -220,6 +219,34 @@ public class ApiHttpClient : IApiHttpClient
return await SendRequestAsync<TResponse>(request, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Sends a PUT request with a multipart form containing a single file to the specified <paramref name="endpoint"/> as an asynchronous operation and returns the result.
/// </summary>
/// <typeparam name="TResponse">The expected type of the response content.</typeparam>
/// <param name="endpoint">The API endpoint where the request is being sent.</param>
/// <param name="fileStream">The stream of the file to upload.</param>
/// <param name="fileName">The name of the file to upload.</param>
/// <param name="fieldName">The name of the form field carrying the file.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The deserialized response containing the result of the PUT request.</returns>
public async Task<TResponse> PutMultipartAsync<TResponse>(string endpoint, Stream fileStream, string fileName, string fieldName, CancellationToken cancellationToken = default)
{
// The file is streamed as a generic binary part, since the exact content type of the uploaded file is not known.
using MultipartFormDataContent form = [];
using StreamContent fileContent = new(fileStream);
fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
form.Add(fileContent, fieldName, fileName);
using HttpRequestMessage request = new(HttpMethod.Put, endpoint)
{
Content = form
};
AuthenticationHeaderValue? authenticationHeader = GetAuthenticationHeader();
if (authenticationHeader is not null)
request.Headers.Authorization = authenticationHeader;
return await SendRequestAsync<TResponse>(request, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Sends an HTTP request and deserializes the response into the specified type if the request is successful.
/// If the request fails, it attempts to deserialize the response content into a <see cref="ProblemDetailsDto"/> and throws an <see cref="ApiException"/>.
@@ -231,13 +258,13 @@ public class ApiHttpClient : IApiHttpClient
/// <exception cref="ApiException">Thrown if the response is not successful, with the <see cref="ProblemDetailsDto"/> if available.</exception>
private async Task<TResponse> SendRequestAsync<TResponse>(HttpRequestMessage request, CancellationToken cancellationToken)
{
// send the HTTP request and read the response
// Send the HTTP request and read the response.
HttpResponseMessage response = await _httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
string content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
// if the response is successful, deserialize the content to TResponse and return it
// If the response is successful, deserialize the content to TResponse and return it.
if (response.IsSuccessStatusCode)
{
// handle empty content case
// Handle empty content case.
if (string.IsNullOrEmpty(content))
return default!;
return JsonSerializer.Deserialize<TResponse>(content, _jsonOptions)!;
@@ -245,12 +272,12 @@ public class ApiHttpClient : IApiHttpClient
else
{
ProblemDetailsDto? problemDetails = null;
// attempt to deserialize the response content to ProblemDetailsDto if the request fails
// Attempt to deserialize the response content to ProblemDetailsDto if the request fails.
try
{
problemDetails = JsonSerializer.Deserialize<ProblemDetailsDto>(content, _jsonOptions);
}
catch { /* if we can't deserialize to ProblemDetails, we'll just use the status code */ }
catch { /* If we can't deserialize to ProblemDetails, we'll just use the status code. */ }
throw new ApiException(problemDetails, response.StatusCode, request.RequestUri?.AbsolutePath);
}
}
@@ -57,6 +57,18 @@ public interface IApiHttpClient
/// <returns>The deserialized response containing the result of the PUT request.</returns>
Task<TResponse> PutAsync<TResponse, TModel>(string endpoint, TModel data, CancellationToken cancellationToken = default);
/// <summary>
/// Sends a PUT request with a multipart form containing a single file to the specified <paramref name="endpoint"/> as an asynchronous operation and returns the result.
/// </summary>
/// <typeparam name="TResponse">The expected type of the response content.</typeparam>
/// <param name="endpoint">The API endpoint where the request is being sent.</param>
/// <param name="fileStream">The stream of the file to upload.</param>
/// <param name="fileName">The name of the file to upload.</param>
/// <param name="fieldName">The name of the form field carrying the file.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The deserialized response containing the result of the PUT request.</returns>
Task<TResponse> PutMultipartAsync<TResponse>(string endpoint, Stream fileStream, string fileName, string fieldName, CancellationToken cancellationToken = default);
/// <summary>
/// Sends a POST request with a multipart form containing a single file to the specified <paramref name="endpoint"/> as an asynchronous operation and returns the result.
/// </summary>
@@ -0,0 +1,143 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.MediaContributors;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object carrying the full details of a book, as stored in the media library.
/// </summary>
[DebuggerDisplay("Title: {Metadata?.Title}")]
public class BookDetailsDto
{
/// <summary>
/// Gets or sets the Id of the book.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the Id of the media library this book belongs to.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the file system path of the book.
/// </summary>
public string Path { get; set; } = null!;
/// <summary>
/// Gets or sets the written content metadata of the book.
/// </summary>
public WrittenContentMetadataDto? Metadata { get; set; }
/// <summary>
/// Gets or sets the format of the book (e.g., Hardcover, Paperback), if applicable.
/// </summary>
public BookFormat? Format { get; set; }
/// <summary>
/// Gets or sets the edition of the book, if applicable.
/// </summary>
public string? Edition { get; set; }
/// <summary>
/// Gets or sets the volume or book number in the series, if applicable.
/// </summary>
public float? VolumeNumber { get; set; }
/// <summary>
/// Gets or sets the ASIN (Amazon Standard Identification Number) of the book, if applicable.
/// </summary>
public string? ASIN { get; set; }
/// <summary>
/// Gets or sets the Goodreads Id of the book, if applicable.
/// </summary>
public string? GoodreadsId { get; set; }
/// <summary>
/// Gets or sets the Library of Congress Control Number (LCCN) of the book, if applicable.
/// </summary>
public string? LCCN { get; set; }
/// <summary>
/// Gets or sets the OCLC Number (WorldCat identifier) of the book, if applicable.
/// </summary>
public string? OCLCNumber { get; set; }
/// <summary>
/// Gets or sets the Open Library Id of the book, if applicable.
/// </summary>
public string? OpenLibraryId { get; set; }
/// <summary>
/// Gets or sets the LibraryThing Id of the book, if applicable.
/// </summary>
public string? LibraryThingId { get; set; }
/// <summary>
/// Gets or sets the Google Books Id of the book, if applicable.
/// </summary>
public string? GoogleBooksId { get; set; }
/// <summary>
/// Gets or sets the Barnes &amp; Noble Id of the book, if applicable.
/// </summary>
public string? BarnesAndNobleId { get; set; }
/// <summary>
/// Gets or sets the Apple Books Id of the book, if applicable.
/// </summary>
public string? AppleBooksId { get; set; }
/// <summary>
/// Gets or sets the list of ISBN (International Standard Book Number) of the book.
/// </summary>
public List<IsbnDto>? ISBNs { get; set; }
/// <summary>
/// Gets or sets the list of media contributors of the book.
/// </summary>
public List<MediaContributorDto>? Contributors { get; set; }
/// <summary>
/// Gets or sets the list of ratings of the book.
/// </summary>
public List<BookRatingDto>? Ratings { get; set; }
/// <summary>
/// Gets or sets the status of the metadata enrichment of the book.
/// </summary>
public string? MetadataStatus { get; set; }
/// <summary>
/// Gets or sets the date and time when the metadata of the book was last enriched, if applicable.
/// </summary>
public DateTime? LastMetadataUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that enriched the metadata of the book, if applicable.
/// </summary>
public string? MetadataProvider { get; set; }
/// <summary>
/// Gets or sets the date and time when the book was created.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional date and time when the book was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the path of the cover image of the book, if available.
/// </summary>
public string? CoverPath { get; set; }
}
@@ -1,5 +1,4 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
@@ -8,8 +7,8 @@ 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. Required.</param>
/// <param name="Id">The unique identifier of the book to retrieve, taken from the route. Required.</param>
[DebuggerDisplay("Id: {Id}")]
public record GetBookRequest(
Guid Id
string Id
);
@@ -0,0 +1,107 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.MediaContributors;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
/// <summary>
/// Represents a request to update an existing book.
/// </summary>
[DebuggerDisplay("Title: {Metadata?.Title}")]
public class UpdateBookRequest
{
/// <summary>
/// Gets or sets the Id of the book to update, taken from the route.
/// </summary>
public string? Id { get; set; }
/// <summary>
/// Gets or sets the written content metadata of the book.
/// </summary>
public WrittenContentMetadataDto? Metadata { get; set; }
/// <summary>
/// Gets or sets the format of the book (e.g., Hardcover, Paperback), if applicable.
/// </summary>
public BookFormat? Format { get; set; }
/// <summary>
/// Gets or sets the edition of the book, if applicable.
/// </summary>
public string? Edition { get; set; }
/// <summary>
/// Gets or sets the volume or book number in the series, if applicable.
/// </summary>
public float? VolumeNumber { get; set; }
/// <summary>
/// Gets or sets the series name, if the book is part of a series.
/// </summary>
public BookSeriesDto? Series { get; set; }
/// <summary>
/// Gets or sets the ASIN (Amazon Standard Identification Number) of the book, if applicable.
/// </summary>
public string? ASIN { get; set; }
/// <summary>
/// Gets or sets the Goodreads Id of the book, if applicable.
/// </summary>
public string? GoodreadsId { get; set; }
/// <summary>
/// Gets or sets the Library of Congress Control Number (LCCN) of the book, if applicable.
/// </summary>
public string? LCCN { get; set; }
/// <summary>
/// Gets or sets the OCLC Number (WorldCat identifier) of the book, if applicable.
/// </summary>
public string? OCLCNumber { get; set; }
/// <summary>
/// Gets or sets the Open Library Id of the book, if applicable.
/// </summary>
public string? OpenLibraryId { get; set; }
/// <summary>
/// Gets or sets the LibraryThing Id of the book, if applicable.
/// </summary>
public string? LibraryThingId { get; set; }
/// <summary>
/// Gets or sets the Google Books Id of the book, if applicable.
/// </summary>
public string? GoogleBooksId { get; set; }
/// <summary>
/// Gets or sets the Barnes &amp; Noble Id of the book, if applicable.
/// </summary>
public string? BarnesAndNobleId { get; set; }
/// <summary>
/// Gets or sets the Apple Books Id of the book, if applicable.
/// </summary>
public string? AppleBooksId { get; set; }
/// <summary>
/// Gets or sets the list of ISBN (International Standard Book Number) of the book.
/// </summary>
public List<IsbnDto>? ISBNs { get; set; }
/// <summary>
/// Gets or sets the list of media contributors of the book.
/// </summary>
public List<MediaContributorDto>? Contributors { get; set; }
/// <summary>
/// Gets or sets the list of ratings of the book.
/// </summary>
public List<BookRatingDto>? Ratings { get; set; }
}
@@ -11,6 +11,9 @@ public static partial class ApiRoutes
public static class Books
{
public const string GET_BOOKS_LITE = "books/lite";
public const string GET_BOOK = "books/{id}";
public const string UPDATE_BOOK = "books/{id}";
public const string UPDATE_BOOK_COVER = "books/{id}/cover";
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}";
@@ -13,6 +13,9 @@ 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 GET_BOOK_DETAILS = "{culture}/library/written-content-library/books-library/books/{id}/api-get-book";
public const string SAVE_BOOK = "{culture}/library/written-content-library/books-library/books/{id}/api-save-book";
public const string UPDATE_BOOK_COVER = "{culture}/library/written-content-library/books-library/books/{id}/api-update-cover";
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";
@@ -1,10 +1,21 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Themes;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Primitives;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Lumina.Presentation.Web.Core.Themes;
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -16,6 +27,42 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.B
/// </summary>
public class EditBookViewEndpoint : BaseEndpoint<GetBookRequest, IResult>
{
// The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath,
// so "Lumina.Presentation.Web.Views.X" resolves to the embedded "Lumina.Presentation.Web.Core.Resources.Views.X" resource; including "Core" here would insert it twice.
private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Library.WrittenContentLibrary.BookLibrary.Books.Item";
private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web";
// The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope.
private const string VIEW_PAGE_KEY = "library/written-content-library/book-library/books/item";
private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Converters = { new JsonStringEnumConverter() }
};
private readonly IApiHttpClient _apiHttpClient;
private readonly IUrlService _urlService;
private readonly ThemePageRenderer _themePageRenderer;
private readonly IAntiforgery _antiforgery;
private readonly IStringLocalizer _localizer;
/// <summary>
/// Initializes a new instance of the <see cref="EditBookViewEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
/// <param name="urlService">Injected service for generating URLs from action and controller names, with localization.</param>
/// <param name="themePageRenderer">Injected service for rendering themed pages.</param>
/// <param name="antiforgery">Injected service for anti-forgery token handling.</param>
/// <param name="stringLocalizerFactory">Injected factory used to create the localizer of the view resources.</param>
public EditBookViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory)
{
_apiHttpClient = apiHttpClient;
_urlService = urlService;
_themePageRenderer = themePageRenderer;
_antiforgery = antiforgery;
_localizer = stringLocalizerFactory.Create(VIEW_RESOURCE_BASE_NAME, VIEW_RESOURCE_LOCATION);
}
/// <summary>
/// Configures the endpoint.
/// </summary>
@@ -29,12 +76,58 @@ public class EditBookViewEndpoint : BaseEndpoint<GetBookRequest, IResult>
}
/// <summary>
/// Displays the book editing view.
/// Displays the book editing view, rendered by the active theme with a fallback to the Razor view.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="request">The request containing the Id of the book to view.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override Task<IResult> ExecuteAsync(GetBookRequest request, CancellationToken cancellationToken)
public override async Task<IResult> ExecuteAsync(GetBookRequest request, CancellationToken cancellationToken)
{
return Task.FromResult(View("/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml"));
// The view needs the full details of the book to show its current values, so they are fetched from the API up front; the route
// value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted route value can never escape
// its URL segment, and an unparseable id is reported by the API as a missing book id.
request = request with { Id = Guid.TryParse(request.Id, out Guid bookId) ? bookId.ToString() : Guid.Empty.ToString() };
BookDetailsDto book = await _apiHttpClient.GetAsync<BookDetailsDto>(ApiRoutes.Books.GET_BOOK.Replace("{id}", request.Id), cancellationToken).ConfigureAwait(false);
string title = book.Metadata?.Title ?? string.Empty;
// The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it.
AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext);
// The theme template receives the book data, the URLs of the actions of the view and the localized strings as page data,
// serialized as JSON so that the template can bind them without executing server side code of its own.
ThemePageDto pageModel = new()
{
PageKey = VIEW_PAGE_KEY,
Title = title,
Description = string.Empty,
PageData = new Dictionary<string, object?>
{
["bookId"] = book.Id.ToString(),
["libraryId"] = book.LibraryId.ToString(),
["antiforgeryToken"] = antiforgeryTokens.RequestToken,
["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.SAVE_BOOK, new { id = default(Guid) }) ?? string.Empty,
["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.UPDATE_BOOK_COVER, new { id = default(Guid) }) ?? string.Empty,
["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX) ?? string.Empty) + "?libraryId=" + book.LibraryId,
["bookJson"] = JsonSerializer.Serialize(book, s_camelCaseJsonOptions),
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer),
["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions)
}
};
// Themed rendering is best effort: when the active theme does not provide the item template, the plain Razor fallback is rendered instead.
Result<ThemePageRenderResultDto> sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false);
if (sectionResult.IsFailure)
{
Dictionary<string, object?> viewData = new()
{
["Title"] = title
};
return View("/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml", book, viewData);
}
// On a healthy site the page is composed by the theme, so the theme content and script are wrapped in the shared themed view.
return View(
"/Core/Views/Shared/_ThemedView.cshtml",
new ThemeViewDto(sectionResult.Value.Content, sectionResult.Value.Script),
new Dictionary<string, object?> { ["Title"] = title });
}
}
@@ -24,7 +24,7 @@ public class EditBookViewEndpointSummary : Summary<EditBookViewEndpoint, GetBook
RequestParam(r => r.Id, "The unique identifier of the book to edit. Required.");
ExampleRequest = new GetBookRequest(
Id: Guid.NewGuid()
Id: Guid.NewGuid().ToString()
);
Response(200, "The view for editing the book is rendered.");
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
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.GetBookDetails;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{id}/api-get-book</c> route.
/// </summary>
public class GetBookDetailsEndpoint : BaseEndpoint<GetBookRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetBookDetailsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetBookDetailsEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.GET_BOOK_DETAILS);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Retrieves the full details of the book identified by <paramref name="request"/>.
/// </summary>
/// <param name="request">The request containing the Id of the book to retrieve.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBookRequest request, CancellationToken cancellationToken)
{
// The route value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted route value can
// never escape its URL segment, and an unparseable id is reported by the API as a missing book id.
request = request with { Id = Guid.TryParse(request.Id, out Guid bookId) ? bookId.ToString() : Guid.Empty.ToString() };
BookDetailsDto book = await _apiHttpClient.GetAsync<BookDetailsDto>(ApiRoutes.Books.GET_BOOK.Replace("{id}", request.Id), cancellationToken).ConfigureAwait(false);
return JsonSuccess(book);
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetBookDetails;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetBookDetailsEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetBookDetailsEndpointSummary : Summary<GetBookDetailsEndpoint, GetBookRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetBookDetailsEndpointSummary"/> class.
/// </summary>
public GetBookDetailsEndpointSummary()
{
Summary = "Gets the details of a book.";
Description = "Gets the full details of the book identified by the request, for the details and editing view.";
RequestParam(r => r.Id, "The unique identifier of the book to get. Required.");
ExampleRequest = new GetBookRequest(
Id: Guid.NewGuid().ToString()
);
Response(200, "The details of the book are returned.", example: new SuccessResponse<BookDetailsDto>(true, default));
}
}
@@ -87,6 +87,7 @@ public class BooksIndexViewEndpoint : BaseEndpoint<GetBooksViewRequest, IResult>
["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,
["detailsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.EDIT_BOOK, new { id = default(Guid) }) ?? string.Empty,
["availabilityUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.GET_READING_AVAILABILITY, new { bookId = default(Guid) }) ?? string.Empty,
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer)
}
@@ -0,0 +1,63 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
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.SaveBook;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{id}/api-save-book</c> route.
/// </summary>
public class SaveBookEndpoint : BaseEndpoint<UpdateBookRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="SaveBookEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public SaveBookEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.PUT);
Routes(WebRoutes.Books.SAVE_BOOK);
DontAutoTag();
Options(options => options.WithTags("Books"));
EnableAntiforgery();
}
/// <summary>
/// Updates the book described by <paramref name="request"/>.
/// </summary>
/// <param name="request">The request containing the edited details of the book.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(UpdateBookRequest request, CancellationToken cancellationToken)
{
// The book is identified by the {id} route value, not by the id posted in the form, so that a mismatched id can never redirect
// the update to another book; the value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted
// route value can never escape its URL segment, and an unparseable id is reported by the API as a missing book id.
string routeId = HttpContext.Request.RouteValues["id"]?.ToString() ?? string.Empty;
request.Id = Guid.TryParse(routeId, out Guid bookId) ? bookId.ToString() : Guid.Empty.ToString();
BookDetailsDto book = await _apiHttpClient.PutAsync<BookDetailsDto, UpdateBookRequest>(
ApiRoutes.Books.UPDATE_BOOK.Replace("{id}", request.Id), request, cancellationToken).ConfigureAwait(false);
return JsonSuccess(book);
}
}
@@ -0,0 +1,159 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaContributors;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.SaveBook;
/// <summary>
/// Class used for providing a textual description for the <see cref="SaveBookEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class SaveBookEndpointSummary : Summary<SaveBookEndpoint, UpdateBookRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="SaveBookEndpointSummary"/> class.
/// </summary>
public SaveBookEndpointSummary()
{
Summary = "Updates a book.";
Description = "Updates the details of the book identified by the request.";
RequestParam(r => r.Id, "The unique identifier of the book to update. Required.");
RequestParam(r => r.Metadata, "The written content metadata of the book. Required.");
RequestParam(r => r.Metadata!.Title, "The title of the book. Required.");
RequestParam(r => r.Metadata!.OriginalTitle, "The original title of the book, if different from the current title. Optional.");
RequestParam(r => r.Metadata!.Description, "A brief description or summary of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo, "The release information, including release date and other relevant details. Required.");
RequestParam(r => r.Metadata!.ReleaseInfo!.OriginalReleaseDate, "The original release date of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.OriginalReleaseYear, "The original release year of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReReleaseDate, "The re-release date of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReReleaseYear, "The re-release year of the book. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReleaseCountry, "The country where the book was released. Optional.");
RequestParam(r => r.Metadata!.ReleaseInfo!.ReleaseVersion, "The version or edition of the release of the book. Optional.");
RequestParam(r => r.Metadata!.Genres, "The list of genres of the book. Required.");
RequestParam(r => r.Metadata!.Tags, "The list of tags of the book. Required.");
RequestParam(r => r.Metadata!.Language, "The language in which the book is written. Optional.");
RequestParam(r => r.Metadata!.Language!.LanguageCode, "The ISO code of the language of the book. Optional.");
RequestParam(r => r.Metadata!.Language!.LanguageName, "The name of the language of the book in English. Optional.");
RequestParam(r => r.Metadata!.Language!.NativeName, "The native name of the language of the book. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage, "The original language of the book, if it has been translated. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.LanguageCode, "The ISO code of the original language of the book. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.LanguageName, "The name of the original language of the book in English. Optional.");
RequestParam(r => r.Metadata!.OriginalLanguage!.NativeName, "The native name of the original language of the book. Optional.");
RequestParam(r => r.Metadata!.Publisher, "The publisher of the book. Optional.");
RequestParam(r => r.Metadata!.PageCount, "The number of pages of the book. Optional.");
RequestParam(r => r.Format, "The format of the book (e.g., Hardcover, Paperback). Optional.");
RequestParam(r => r.Edition, "The edition of the book. Optional.");
RequestParam(r => r.VolumeNumber, "The volume or book number in the series. Optional.");
RequestParam(r => r.Series, "The series the book is part of. Optional.");
RequestParam(r => r.Series!.Title, "The title of the series the book is part of. Optional.");
RequestParam(r => r.ASIN, "The ASIN (Amazon Standard Identification Number) of the book. Optional.");
RequestParam(r => r.GoodreadsId, "The Goodreads Id of the book. Optional.");
RequestParam(r => r.LCCN, "The Library of Congress Control Number (LCCN) of the book. Optional.");
RequestParam(r => r.OCLCNumber, "The OCLC Number (WorldCat identifier) of the book. Optional.");
RequestParam(r => r.OpenLibraryId, "The Open Library Id of the book. Optional.");
RequestParam(r => r.LibraryThingId, "The LibraryThing Id of the book. Optional.");
RequestParam(r => r.GoogleBooksId, "The Google Books Id of the book. Optional.");
RequestParam(r => r.BarnesAndNobleId, "The Barnes & Noble Id of the book. Optional.");
RequestParam(r => r.AppleBooksId, "The Apple Books Id of the book. Optional.");
RequestParam(r => r.ISBNs, "The list of ISBN (International Standard Book Number) of the book. Required.");
RequestParam(r => r.Contributors, "The list of media contributors of the book. Required.");
RequestParam(r => r.Ratings, "The list of ratings of the book. Required.");
ExampleRequest = new UpdateBookRequest
{
Id = Guid.NewGuid().ToString(),
Metadata = new WrittenContentMetadataDto
{
Title = "The Fellowship of the Ring",
OriginalTitle = "The Fellowship of the Ring",
Description = "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
ReleaseInfo = new ReleaseInfoDto
{
OriginalReleaseDate = new DateOnly(1954, 7, 29),
OriginalReleaseYear = 1954,
ReReleaseDate = new DateOnly(2001, 9, 6),
ReReleaseYear = 2001,
ReleaseCountry = "uk",
ReleaseVersion = "50th Anniversary Edition"
},
Genres =
[
new GenreDto { Name = "fantasy" },
new GenreDto { Name = "adventure" },
new GenreDto { Name = "classic" }
],
Tags =
[
new TagDto { Name = "epic fantasy" },
new TagDto { Name = "quest" },
new TagDto { Name = "middle-earth" }
],
Language = new LanguageInfoDto
{
LanguageCode = "en",
LanguageName = "English",
NativeName = "English"
},
OriginalLanguage = new LanguageInfoDto
{
LanguageCode = "en",
LanguageName = "English",
NativeName = "English"
},
Publisher = "Houghton Mifflin",
PageCount = 398
},
Format = BookFormat.Paperback,
Edition = "50th Anniversary Edition",
VolumeNumber = 1,
Series = new BookSeriesDto
{
Title = "The Lord of the Rings"
},
ASIN = "B007978NPG",
GoodreadsId = "3",
LCCN = "54009621",
OCLCNumber = "ocm00012345",
OpenLibraryId = "OL7603910M",
LibraryThingId = "3203347",
GoogleBooksId = "aWZzLPhY4o0C",
BarnesAndNobleId = "1100307790",
AppleBooksId = "id395211",
ISBNs =
[
new IsbnDto { Value = "0395272238", Format = IsbnFormat.Isbn10 },
new IsbnDto { Value = "9780395272237", Format = IsbnFormat.Isbn13 }
],
Contributors =
[
new MediaContributorDto
{
Name = new MediaContributorNameDto { DisplayName = "J.R.R. Tolkien", LegalName = "John Ronald Reuel Tolkien" },
Role = new MediaContributorRoleDto { Name = "author", Category = "Author" }
},
new MediaContributorDto
{
Name = new MediaContributorNameDto { DisplayName = "Alan Lee", LegalName = "Alan Lee" },
Role = new MediaContributorRoleDto { Name = "illustrator", Category = "Illustrator" }
}
],
Ratings =
[
new BookRatingDto { Source = BookRatingSource.GoogleBooks, Value = 4.36M, MaxValue = 5, VoteCount = 2345678 },
new BookRatingDto { Source = BookRatingSource.Amazon, Value = 4.7M, MaxValue = 5, VoteCount = 87654 }
]
};
Response(200, "The updated book is returned.", example: new SuccessResponse<BookDetailsDto>(true, default));
}
}
@@ -0,0 +1,68 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
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.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBookCover;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{id}/api-update-cover</c> route.
/// </summary>
public class UpdateBookCoverEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public UpdateBookCoverEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.PUT);
Routes(WebRoutes.Books.UPDATE_BOOK_COVER);
DontAutoTag();
Options(options => options.WithTags("Books"));
EnableAntiforgery();
}
/// <summary>
/// Updates the cover image of the book with the image uploaded in the multipart form of the request.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The endpoint takes no typed request, because its body is a multipart file, so the book id is read from the {id} route
// value; an unparseable value becomes Guid.Empty, which the upstream API reports as a missing book id.
Guid bookId = Guid.TryParse(HttpContext.Request.RouteValues["id"]?.ToString(), out Guid parsedBookId) ? parsedBookId : Guid.Empty;
// The cover is the first file of the multipart form, and without it the request cannot update anything.
IFormFile? cover = HttpContext.Request.Form.Files.Count > 0 ? HttpContext.Request.Form.Files[0] : null;
if (cover is null)
return Results.Problem(statusCode: StatusCodes.Status400BadRequest, detail: "The uploaded cover image is missing.");
// The cover stream must stay open while the file is streamed to the API, and is disposed when the request completes.
await using Stream coverStream = cover.OpenReadStream();
string? coverPath = await _apiHttpClient.PutMultipartAsync<string>(
ApiRoutes.Books.UPDATE_BOOK_COVER.Replace("{id}", bookId.ToString()), coverStream, cover.FileName, "cover", cancellationToken).ConfigureAwait(false);
return JsonSuccess(coverPath);
}
}
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.UpdateBookCover;
/// <summary>
/// Class used for providing a textual description for the <see cref="UpdateBookCoverEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class UpdateBookCoverEndpointSummary : Summary<UpdateBookCoverEndpoint, EmptyRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateBookCoverEndpointSummary"/> class.
/// </summary>
public UpdateBookCoverEndpointSummary()
{
Summary = "Updates the cover image of a book.";
Description = "Updates the cover image of the book identified by the request, with the image uploaded in the multipart form of the request.";
Response(200, "The relative path of the stored cover image is returned.", example: new SuccessResponse<string>(true, default));
}
}
@@ -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>
@@ -51,4 +51,10 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>قارئ الكتب الذي يفتح هذا الكتاب معطل لهذه المكتبة. قم بتمكينه في إعدادات المكتبة لقراءة الكتاب.</value>
</data>
<data name="Read" xml:space="preserve">
<value>اقرأ</value>
</data>
<data name="ViewDetails" 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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Lesen</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>Details anzeigen</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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Read</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>View details</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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Leer</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>Ver detalles</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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Lire</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>Voir les détails</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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Leggi</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>Visualizza dettagli</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>
@@ -51,4 +51,10 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>この本を開くブックリーダーは、このライブラリで無効になっています。ライブラリ設定で有効にすると本を読めます。</value>
</data>
<data name="Read" xml:space="preserve">
<value>読む</value>
</data>
<data name="ViewDetails" 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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Read</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>View details</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>
@@ -51,4 +51,10 @@
<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>
<data name="Read" xml:space="preserve">
<value>Citește</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>Vezi detalii</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>
@@ -51,4 +51,10 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>Читач книг, який відкриває цю книгу, вимкнено для цієї бібліотеки. Увімкніть його в налаштуваннях бібліотеки, щоб читати книгу.</value>
</data>
<data name="Read" xml:space="preserve">
<value>Читати</value>
</data>
<data name="ViewDetails" 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>
@@ -51,4 +51,10 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>打开此图书的图书阅读器已在此媒体库中禁用。在媒体库设置中启用它即可阅读该图书。</value>
</data>
<data name="Read" xml:space="preserve">
<value>阅读</value>
</data>
<data name="ViewDetails" xml:space="preserve">
<value>查看详情</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>إضافة مساهم</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>إضافة تقييم</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>إضافة</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>معرّف الكتاب على Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>رقم التعريف القياسي لأمازون الخاص بالكتاب.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>كتاب صوتي</value>
</data>
<data name="Author" xml:space="preserve">
<value>مؤلف</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>العودة إلى المكتبة</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>معرّف الكتاب على Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>كتاب من الورق المقوى</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>تفاصيل الكتاب</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>تم حفظ الكتاب.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>تغيير الغلاف</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>الاسم</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>الأشخاص الذين ساهموا في الكتاب، مثل مؤلفيه.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>صورة الغلاف</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>تم تحديث صورة الغلاف.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>تعذر رفع صورة الغلاف.</value>
</data>
<data name="Description" xml:space="preserve">
<value>الوصف</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>ملخص قصير أو وصف للكتاب.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>كتاب إلكتروني</value>
</data>
<data name="Edition" xml:space="preserve">
<value>الطبعة</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>طبعة الكتاب.</value>
</data>
<data name="Format" xml:space="preserve">
<value>الصيغة</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>الصيغة المادية أو الرقمية للكتاب.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>معلومات عامة</value>
</data>
<data name="Genres" xml:space="preserve">
<value>الأنواع</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>أنواع الكتاب، مفصولة بفواصل.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>المعرّف الرقمي للكتاب على Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>معرّف الكتاب على Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>غلاف مقوى</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>المعرّفات</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>رسام</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>صيغة ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>أرقام الكتاب الدولية المعيارية (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>قيمة ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>اللغة</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>رمز اللغة</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>رمز الحرفين للغة الكتاب.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>اسم اللغة</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>اسم لغة الكتاب.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>حرف كبير</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>رقم ضبط مكتبة الكونغرس للكتاب.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>تجليد جلدي</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>تجليد مكتبي</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>معرّف الكتاب على LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>ورقي للسوق الشامل</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>راوٍ</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>الاسم الأصلي للغة</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>الاسم الأصلي للغة الكتاب.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>لا يوجد غلاف</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>رقم OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>رقم OCLC للكتاب.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>معرّف الكتاب على Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>اللغة الأصلية</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>رمز اللغة الأصلية</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>رمز الحرفين للغة الأصلية للكتاب.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>اسم اللغة الأصلية</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>اسم اللغة الأصلية للكتاب.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>الاسم الأصلي للغة الأصلية</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>الاسم الأصلي للغة الأصلية للكتاب.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>تاريخ الإصدار الأصلي</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>التاريخ الذي صدر فيه الكتاب لأول مرة.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>سنة الإصدار الأصلي</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>السنة التي صدر فيها الكتاب لأول مرة.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>العنوان الأصلي</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>العنوان الأصلي للكتاب، عندما يختلف عن العنوان الحالي.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>أخرى</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>عدد الصفحات</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>عدد صفحات الكتاب.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>غلاف ورقي</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>كتاب منبثق</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>الناشر</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>ناشر الكتاب.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>ناشر</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>أقصى تقييم</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>التقييمات</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>تقييمات الكتاب من مصادر مختلفة.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>المصدر</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>التقييم</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>عدد الأصوات</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>بلد الإصدار</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>رمز الحرفين لبلد الإصدار.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>معلومات الإصدار</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>نسخة الإصدار</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>نسخة الإصدار، مثل النسخة الأصلية.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>إزالة</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>تاريخ إعادة الإصدار</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>التاريخ الذي أعيد فيه إصدار الكتاب.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>سنة إعادة الإصدار</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>السنة التي أعيد فيها إصدار الكتاب.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>فئة الدور</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>الدور</value>
</data>
<data name="Save" xml:space="preserve">
<value>حفظ</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>تعذر حفظ الكتاب.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>تجليد حلزوني</value>
</data>
<data name="Tags" xml:space="preserve">
<value>الوسوم</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>وسوم الكتاب، مفصولة بفواصل.</value>
</data>
<data name="Title" xml:space="preserve">
<value>العنوان</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>العنوان الرئيسي للكتاب.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>ورقي تجاري</value>
</data>
<data name="Translator" xml:space="preserve">
<value>مترجم</value>
</data>
<data name="User" xml:space="preserve">
<value>مستخدم</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>رقم المجلد</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>رقم مجلد الكتاب ضمن سلسلته.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>معرّف Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>معرّف Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>معرّف LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>معرّف Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>معرّف Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>المساهمون</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>معرّف Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Mitwirkenden hinzufügen</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Bewertung hinzufügen</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Hinzufügen</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>Die Kennung des Buches bei Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>Die Amazon-Standard-Identifikationsnummer des Buches.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Hörbuch</value>
</data>
<data name="Author" xml:space="preserve">
<value>Autor</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Zurück zur Bibliothek</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>Die Kennung des Buches bei Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Pappbilderbuch</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Buchdetails</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>Das Buch wurde gespeichert.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Titelbild ändern</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Name</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Die Personen, die zum Buch beigetragen haben, wie seine Autoren.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Titelbild</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>Das Titelbild wurde aktualisiert.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>Das Titelbild konnte nicht hochgeladen werden.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Beschreibung</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Eine kurze Zusammenfassung oder Beschreibung des Buches.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>eBook</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Ausgabe</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>Die Ausgabe des Buches.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>Das physische oder digitale Format des Buches.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Allgemeine Informationen</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>Die Genres des Buches, durch Kommas getrennt.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>Die numerische Kennung des Buches bei Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>Die Kennung des Buches bei Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Gebundene Ausgabe</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Kennungen</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Illustrator</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>ISBN-Format</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>Die Internationalen Standardbuchnummern des Buches.</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>ISBN-Wert</value>
</data>
<data name="Language" xml:space="preserve">
<value>Sprache</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Sprachcode</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>Der zweibuchstabige Code der Sprache des Buches.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Sprachname</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>Der Name der Sprache des Buches.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Großdruck</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>Die Library-of-Congress-Kontrollnummer des Buches.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Ledereinband</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Bibliothekseinband</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>Die Kennung des Buches bei LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Massenmarkt-Taschenbuch</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Erzähler</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Muttersprachlicher Name</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>Der muttersprachliche Name der Sprache des Buches.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Kein Titelbild</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>OCLC-Nummer</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>Die OCLC-Nummer des Buches.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>Die Kennung des Buches bei Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Originalsprache</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Code der Originalsprache</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>Der zweibuchstabige Code der Originalsprache des Buches.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Name der Originalsprache</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>Der Name der Originalsprache des Buches.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Muttersprachlicher Name der Originalsprache</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>Der muttersprachliche Name der Originalsprache des Buches.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Datum der Erstveröffentlichung</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>Das Datum, an dem das Buch ursprünglich veröffentlicht wurde.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Jahr der Erstveröffentlichung</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>Das Jahr, in dem das Buch ursprünglich veröffentlicht wurde.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Originaltitel</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>Der Originaltitel des Buches, wenn er vom aktuellen Titel abweicht.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Sonstige</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Seitenzahl</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>Die Seitenzahl des Buches.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Taschenbuch</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Pop-up-Buch</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Verlag</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>Der Verlag des Buches.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Verlag</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Höchstbewertung</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Bewertungen</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Die Bewertungen des Buches aus verschiedenen Quellen.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Quelle</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Bewertung</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Stimmenzahl</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Erscheinungsland</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>Der zweibuchstabige Code des Erscheinungslandes.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Veröffentlichungsinformationen</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Veröffentlichungsversion</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>Die Version der Veröffentlichung, wie die ursprüngliche.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Entfernen</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Datum der Neuveröffentlichung</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>Das Datum, an dem das Buch erneut veröffentlicht wurde.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Jahr der Neuveröffentlichung</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>Das Jahr, in dem das Buch erneut veröffentlicht wurde.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Rollenkategorie</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Rolle</value>
</data>
<data name="Save" xml:space="preserve">
<value>Speichern</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>Das Buch konnte nicht gespeichert werden.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Spiralbindung</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Schlagwörter</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Die Schlagwörter des Buches, durch Kommas getrennt.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Titel</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>Der Haupttitel des Buches.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Trade-Taschenbuch</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Übersetzer</value>
</data>
<data name="User" xml:space="preserve">
<value>Benutzer</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Bandnummer</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>Die Bandnummer des Buches innerhalb seiner Reihe.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Apple-Books-ID</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Google-Books-ID</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>LibraryThing-ID</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Barnes-&amp;-Noble-ID</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Open-Library-ID</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBNs</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Mitwirkende</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Goodreads-ID</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BookDetails" xml:space="preserve">
<value>Book details</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Add</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>General information</value>
</data>
<data name="Title" xml:space="preserve">
<value>Title</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Original title</value>
</data>
<data name="Description" xml:space="preserve">
<value>Description</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Publisher</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Page count</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Edition</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Volume number</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Release information</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Original release date</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Original release year</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Re-release date</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Re-release year</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Release country</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Release version</value>
</data>
<data name="Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Language code</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Language name</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Native name</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Original language</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Original language code</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Original language name</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Original language native name</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identifiers</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Goodreads Id</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>OCLC number</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Open Library Id</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>LibraryThing Id</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Google Books Id</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Barnes &amp; Noble Id</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Apple Books Id</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBNs</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>ISBN value</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>ISBN format</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Contributors</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Name</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Role</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Role category</value>
</data>
<data name="AddContributor" xml:space="preserve">
<value>Add contributor</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Ratings</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Rating</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Maximum rating</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Source</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Vote count</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Add rating</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Cover image</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Change cover</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>No cover</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Remove</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>The main title of the book.</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>The original title of the book, when it differs from the current one.</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>A short summary or description of the book.</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>The publisher of the book.</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>The number of pages of the book.</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>The physical or digital format of the book.</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>The edition of the book.</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>The volume number of the book within its series.</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>The date when the book was originally released.</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>The year when the book was originally released.</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>The date when the book was released again.</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>The year when the book was released again.</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>The two letter code of the country of release.</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>The version of the release, like the original one.</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>The two letter code of the language of the book.</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>The name of the language of the book.</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>The native name of the language of the book.</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>The two letter code of the original language of the book.</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>The name of the original language of the book.</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>The native name of the original language of the book.</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>The genres of the book, separated by commas.</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>The tags of the book, separated by commas.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>The Amazon Standard Identification Number of the book.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>The numeric identifier of the book on Goodreads.</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>The Library of Congress Control Number of the book.</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>The OCLC number of the book.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>The identifier of the book on Open Library.</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>The identifier of the book on LibraryThing.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>The identifier of the book on Google Books.</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>The identifier of the book on Barnes &amp; Noble.</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>The identifier of the book on Apple Books.</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>The International Standard Book Numbers of the book.</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>The people that contributed to the book, like its authors.</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>The ratings of the book from different sources.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Other</value>
</data>
<data name="Author" xml:space="preserve">
<value>Author</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Translator</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Illustrator</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Publisher</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narrator</value>
</data>
<data name="User" xml:space="preserve">
<value>User</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Hardcover</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Paperback</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Mass market paperback</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Trade paperback</value>
</data>
<data name="eBook" xml:space="preserve">
<value>eBook</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Audiobook</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Large print</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Board book</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Spiral bound</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Library binding</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Leather bound</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Pop-up book</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>The book was saved.</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>The cover image was updated.</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>The book could not be saved.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>The cover image could not be uploaded.</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Añadir colaborador</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Añadir valoración</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Añadir</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>El identificador del libro en Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>El número de identificación estándar de Amazon del libro.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Audiolibro</value>
</data>
<data name="Author" xml:space="preserve">
<value>Autor</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Volver a la biblioteca</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>El identificador del libro en Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Libro de cartón</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Detalles del libro</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>El libro se ha guardado.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Cambiar portada</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Nombre</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Las personas que contribuyeron al libro, como sus autores.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Imagen de portada</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>La imagen de portada se ha actualizado.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>La imagen de portada no se ha podido subir.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Descripción</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Un breve resumen o descripción del libro.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>Libro electrónico</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Edición</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>La edición del libro.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Formato</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>El formato físico o digital del libro.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Información general</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Géneros</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>Los géneros del libro, separados por comas.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>El identificador numérico del libro en Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>El identificador del libro en Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Tapa dura</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identificadores</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Ilustrador</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>Formato ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>Los números internacionales normalizados del libro (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>Valor ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>Idioma</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Código de idioma</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>El código de dos letras del idioma del libro.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Nombre del idioma</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>El nombre del idioma del libro.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Letra grande</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>El número de control de la Biblioteca del Congreso del libro.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Encuadernación en piel</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Encuadernación de biblioteca</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>El identificador del libro en LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Bolsillo</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narrador</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Nombre nativo</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>El nombre nativo del idioma del libro.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Sin portada</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>Número OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>El número OCLC del libro.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>El identificador del libro en Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Idioma original</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Código del idioma original</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>El código de dos letras del idioma original del libro.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Nombre del idioma original</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>El nombre del idioma original del libro.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Nombre nativo del idioma original</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>El nombre nativo del idioma original del libro.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Fecha de publicación original</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>La fecha en la que el libro se publicó originalmente.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Año de publicación original</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>El año en el que el libro se publicó originalmente.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Título original</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>El título original del libro, cuando difiere del actual.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Otro</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Número de páginas</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>El número de páginas del libro.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Tapa blanda</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Libro pop-up</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Editorial</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>La editorial del libro.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Editorial</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Valoración máxima</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Valoraciones</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Las valoraciones del libro de distintas fuentes.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Fuente</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Valoración</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Número de votos</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>País de publicación</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>El código de dos letras del país de publicación.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Información de publicación</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Versión de publicación</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>La versión de la publicación, como la original.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Eliminar</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Fecha de reedición</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>La fecha en la que el libro se volvió a publicar.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Año de reedición</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>El año en el que el libro se volvió a publicar.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Categoría de rol</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Rol</value>
</data>
<data name="Save" xml:space="preserve">
<value>Guardar</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>El libro no se ha podido guardar.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Encuadernación en espiral</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Etiquetas</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Las etiquetas del libro, separadas por comas.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Título</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>El título principal del libro.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Rústica</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Traductor</value>
</data>
<data name="User" xml:space="preserve">
<value>Usuario</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Número de volumen</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>El número de volumen del libro dentro de su serie.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>ID de Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>ID de Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>ID de LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>ID de Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>ID de Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBNs</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Colaboradores</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>ID de Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Ajouter un contributeur</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Ajouter une évaluation</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Ajouter</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>L'identifiant du livre sur Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>Le numéro d'identification standard Amazon du livre.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Livre audio</value>
</data>
<data name="Author" xml:space="preserve">
<value>Auteur</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Retour à la bibliothèque</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>L'identifiant du livre sur Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Livre cartonné</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Détails du livre</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>Le livre a été enregistré.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Changer la couverture</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Nom</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Les personnes ayant contribué au livre, comme ses auteurs.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Image de couverture</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>L'image de couverture a été mise à jour.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>L'image de couverture n'a pas pu être téléchargée.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Description</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Un bref résumé ou une description du livre.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>Livre numérique</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Édition</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>L'édition du livre.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>Le format physique ou numérique du livre.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Informations générales</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>Les genres du livre, séparés par des virgules.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>L'identifiant numérique du livre sur Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>L'identifiant du livre sur Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Couverture rigide</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identifiants</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Illustrateur</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>Format ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>Les numéros internationaux normalisés du livre (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>Valeur ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>Langue</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Code de langue</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>Le code à deux lettres de la langue du livre.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Nom de la langue</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>Le nom de la langue du livre.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Gros caractères</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>Le numéro de contrôle de la Library of Congress du livre.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Reliure cuir</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Reliure de bibliothèque</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>L'identifiant du livre sur LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Poche</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narrateur</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Nom natif</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>Le nom natif de la langue du livre.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Aucune couverture</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>Numéro OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>Le numéro OCLC du livre.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>L'identifiant du livre sur Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Langue originale</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Code de la langue originale</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>Le code à deux lettres de la langue originale du livre.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Nom de la langue originale</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>Le nom de la langue originale du livre.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Nom natif de la langue originale</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>Le nom natif de la langue originale du livre.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Date de publication originale</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>La date de publication originale du livre.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Année de publication originale</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>L'année de publication originale du livre.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Titre original</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>Le titre original du livre, lorsqu'il diffère du titre actuel.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Autre</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Nombre de pages</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>Le nombre de pages du livre.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Broché</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Livre animé</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Éditeur</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>L'éditeur du livre.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Éditeur</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Évaluation maximale</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Évaluations</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Les évaluations du livre provenant de différentes sources.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Source</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Évaluation</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Nombre de votes</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Pays de publication</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>Le code à deux lettres du pays de publication.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Informations de publication</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Version de publication</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>La version de la publication, comme la version originale.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Supprimer</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Date de réédition</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>La date de réédition du livre.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Année de réédition</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>L'année de réédition du livre.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Catégorie de rôle</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Rôle</value>
</data>
<data name="Save" xml:space="preserve">
<value>Enregistrer</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>Le livre n'a pas pu être enregistré.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Reliure spirale</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Étiquettes</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Les étiquettes du livre, séparées par des virgules.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Titre</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>Le titre principal du livre.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Grand format broché</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Traducteur</value>
</data>
<data name="User" xml:space="preserve">
<value>Utilisateur</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Numéro de volume</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>Le numéro de volume du livre au sein de sa série.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Identifiant Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Identifiant Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>Identifiant LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Identifiant Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Identifiant Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBNs</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Contributeurs</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Identifiant Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Aggiungi collaboratore</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Aggiungi valutazione</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Aggiungi</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>L'identificatore del libro su Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>Il numero di identificazione standard Amazon del libro.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Audiolibro</value>
</data>
<data name="Author" xml:space="preserve">
<value>Autore</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Torna alla biblioteca</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>L'identificatore del libro su Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Libro cartonato</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Dettagli del libro</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>Il libro è stato salvato.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Cambia copertina</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Nome</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Le persone che hanno contribuito al libro, come i suoi autori.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Immagine di copertina</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>L'immagine di copertina è stata aggiornata.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>L'immagine di copertina non è stato possibile caricarla.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Descrizione</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Un breve riassunto o descrizione del libro.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>Libro elettronico</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Edizione</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>L'edizione del libro.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Formato</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>Il formato fisico o digitale del libro.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Informazioni generali</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Generi</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>I generi del libro, separati da virgole.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>L'identificatore numerico del libro su Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>L'identificatore del libro su Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Copertina rigida</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identificatori</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Illustratore</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>Formato ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>I numeri internazionali normalizzati del libro (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>Valore ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>Lingua</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Codice lingua</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>Il codice di due lettere della lingua del libro.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Nome della lingua</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>Il nome della lingua del libro.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Caratteri grandi</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>Il numero di controllo della Library of Congress del libro.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Legatura in pelle</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Legatura da biblioteca</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>L'identificatore del libro su LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Tascabile</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narratore</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Nome nativo</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>Il nome nativo della lingua del libro.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Nessuna copertina</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>Numero OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>Il numero OCLC del libro.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>L'identificatore del libro su Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Lingua originale</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Codice della lingua originale</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>Il codice di due lettere della lingua originale del libro.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Nome della lingua originale</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>Il nome della lingua originale del libro.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Nome nativo della lingua originale</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>Il nome nativo della lingua originale del libro.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Data di pubblicazione originale</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>La data di pubblicazione originale del libro.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Anno di pubblicazione originale</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>L'anno di pubblicazione originale del libro.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Titolo originale</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>Il titolo originale del libro, quando differisce da quello attuale.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Altro</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Numero di pagine</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>Il numero di pagine del libro.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Brossura</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Libro animato</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Editore</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>L'editore del libro.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Editore</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Valutazione massima</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Valutazioni</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Le valutazioni del libro da diverse fonti.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Fonte</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Valutazione</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Numero di voti</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Paese di pubblicazione</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>Il codice di due lettere del paese di pubblicazione.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Informazioni di pubblicazione</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Versione di pubblicazione</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>La versione della pubblicazione, come quella originale.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Rimuovi</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Data di ripubblicazione</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>La data di ripubblicazione del libro.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Anno di ripubblicazione</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>L'anno di ripubblicazione del libro.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Categoria del ruolo</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Ruolo</value>
</data>
<data name="Save" xml:space="preserve">
<value>Salva</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>Il libro non è stato possibile salvarlo.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Rilegatura a spirale</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Etichette</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Le etichette del libro, separate da virgole.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Titolo</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>Il titolo principale del libro.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Brossura editoriale</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Traduttore</value>
</data>
<data name="User" xml:space="preserve">
<value>Utente</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Numero del volume</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>Il numero del volume del libro all'interno della sua serie.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>ID Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>ID Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>ID LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>ID Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>ID Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Collaboratori</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>ID Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>貢献者を追加</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>評価を追加</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>追加</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>Apple Books上の本のID。</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>本のAmazon標準識別番号。</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>オーディオブック</value>
</data>
<data name="Author" xml:space="preserve">
<value>著者</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>ライブラリに戻る</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>Barnes &amp; Noble上の本のID。</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>ボードブック</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>本の詳細</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>本が保存されました。</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>表紙を変更</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>名前</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>著者など、本に貢献した人々。</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>表紙画像</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>表紙画像が更新されました。</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>表紙画像をアップロードできませんでした。</value>
</data>
<data name="Description" xml:space="preserve">
<value>説明</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>本の簡単な要約または説明。</value>
</data>
<data name="eBook" xml:space="preserve">
<value>電子書籍</value>
</data>
<data name="Edition" xml:space="preserve">
<value>版</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>本の版。</value>
</data>
<data name="Format" xml:space="preserve">
<value>形式</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>本の物理的またはデジタル形式。</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>一般情報</value>
</data>
<data name="Genres" xml:space="preserve">
<value>ジャンル</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>本のジャンル。カンマ区切り。</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>Goodreads上の本の数値ID。</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>Google Books上の本のID。</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>ハードカバー</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>識別子</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>イラストレーター</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>ISBN形式</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>本の国際標準図書番号(ISBN)。</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>言語</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>言語コード</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>本の言語の2文字コード。</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>言語名</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>本の言語名。</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>大活字</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>本の米国議会図書館管理番号。</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>革装</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>図書館製本</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>LibraryThing上の本のID。</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>マスマーケットペーパーバック</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>ナレーター</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>現地語名</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>本の言語の現地語名。</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>表紙なし</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>OCLC番号</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>本のOCLC番号。</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>Open Library上の本のID。</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>原語</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>原語コード</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>本の原語の2文字コード。</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>原語名</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>本の原語名。</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>原語の現地語名</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>本の原語の現地語名。</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>初版発売日</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>本が最初に発売された日付。</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>初版発売年</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>本が最初に発売された年。</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>原題</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>現在のタイトルと異なる場合の本の原題。</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>その他</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>ページ数</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>本のページ数。</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>ペーパーバック</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>飛び出す絵本</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>出版社</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>本の出版社。</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>出版社</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>最大評価</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>評価</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>さまざまな出典による本の評価。</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>出典</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>評価</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>投票数</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>発売国</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>発売国の2文字コード。</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>リリース情報</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>リリース版</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>オリジナル版など、リリースのバージョン。</value>
</data>
<data name="Remove" xml:space="preserve">
<value>削除</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>再発売日</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>本が再発売された日付。</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>再発売年</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>本が再発売された年。</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>役割カテゴリ</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>役割</value>
</data>
<data name="Save" xml:space="preserve">
<value>保存</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>本を保存できませんでした。</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>リング製本</value>
</data>
<data name="Tags" xml:space="preserve">
<value>タグ</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>本のタグ。カンマ区切り。</value>
</data>
<data name="Title" xml:space="preserve">
<value>タイトル</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>本の主タイトル。</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>トレードペーパーバック</value>
</data>
<data name="Translator" xml:space="preserve">
<value>翻訳者</value>
</data>
<data name="User" xml:space="preserve">
<value>ユーザー</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>巻数</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>シリーズ内の本の巻数。</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Apple Books ID</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Google Books ID</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>LibraryThing ID</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Barnes &amp; Noble ID</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Open Library ID</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>貢献者</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Goodreads ID</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BookDetails" xml:space="preserve">
<value>Book details</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Add</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>General information</value>
</data>
<data name="Title" xml:space="preserve">
<value>Title</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Original title</value>
</data>
<data name="Description" xml:space="preserve">
<value>Description</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Publisher</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Page count</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Edition</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Volume number</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Release information</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Original release date</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Original release year</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Re-release date</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Re-release year</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Release country</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Release version</value>
</data>
<data name="Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Language code</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Language name</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Native name</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Original language</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Original language code</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Original language name</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Original language native name</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identifiers</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Goodreads Id</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>OCLC number</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Open Library Id</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>LibraryThing Id</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Google Books Id</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Barnes &amp; Noble Id</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Apple Books Id</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBNs</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>ISBN value</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>ISBN format</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Contributors</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Name</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Role</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Role category</value>
</data>
<data name="AddContributor" xml:space="preserve">
<value>Add contributor</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Ratings</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Rating</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Maximum rating</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Source</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Vote count</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Add rating</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Cover image</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Change cover</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>No cover</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Remove</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>The main title of the book.</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>The original title of the book, when it differs from the current one.</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>A short summary or description of the book.</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>The publisher of the book.</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>The number of pages of the book.</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>The physical or digital format of the book.</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>The edition of the book.</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>The volume number of the book within its series.</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>The date when the book was originally released.</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>The year when the book was originally released.</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>The date when the book was released again.</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>The year when the book was released again.</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>The two letter code of the country of release.</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>The version of the release, like the original one.</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>The two letter code of the language of the book.</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>The name of the language of the book.</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>The native name of the language of the book.</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>The two letter code of the original language of the book.</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>The name of the original language of the book.</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>The native name of the original language of the book.</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>The genres of the book, separated by commas.</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>The tags of the book, separated by commas.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>The Amazon Standard Identification Number of the book.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>The numeric identifier of the book on Goodreads.</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>The Library of Congress Control Number of the book.</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>The OCLC number of the book.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>The identifier of the book on Open Library.</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>The identifier of the book on LibraryThing.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>The identifier of the book on Google Books.</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>The identifier of the book on Barnes &amp; Noble.</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>The identifier of the book on Apple Books.</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>The International Standard Book Numbers of the book.</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>The people that contributed to the book, like its authors.</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>The ratings of the book from different sources.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Other</value>
</data>
<data name="Author" xml:space="preserve">
<value>Author</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Translator</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Illustrator</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Publisher</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narrator</value>
</data>
<data name="User" xml:space="preserve">
<value>User</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Hardcover</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Paperback</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Mass market paperback</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Trade paperback</value>
</data>
<data name="eBook" xml:space="preserve">
<value>eBook</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Audiobook</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Large print</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Board book</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Spiral bound</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Library binding</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Leather bound</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Pop-up book</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>The book was saved.</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>The cover image was updated.</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>The book could not be saved.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>The cover image could not be uploaded.</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Adaugă contributor</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Adaugă rating</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Adaugă</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>Identificatorul cărții pe Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>Numărul standard de identificare Amazon al cărții.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Carte audio</value>
</data>
<data name="Author" xml:space="preserve">
<value>Autor</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Înapoi la bibliotecă</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>Identificatorul cărții pe Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Carte de carton</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Detalii carte</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>Cartea a fost salvată.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Schimbă coperta</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Nume</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Persoanele care au contribuit la carte, precum autorii ei.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Imagine de copertă</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>Imaginea de copertă a fost actualizată.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>Imaginea de copertă nu a putut fi încărcată.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Descriere</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Un scurt rezumat sau o descriere a cărții.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>Carte electronică</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Ediție</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>Ediția cărții.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>Formatul fizic sau digital al cărții.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Informații generale</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genuri</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>Genurile cărții, separate prin virgule.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>Identificatorul numeric al cărții pe Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>Identificatorul cărții pe Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Copertă cartonată</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Identificatori</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Ilustrator</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>Format ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>Numerele internaționale standardizate ale cărții (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>Valoare ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>Limbă</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Codul limbii</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>Codul din două litere al limbii cărții.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Denumirea limbii</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>Denumirea limbii cărții.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Tipar mare</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>Numărul de control al Library of Congress al cărții.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Legare în piele</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Legare de bibliotecă</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>Identificatorul cărții pe LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Ediție de buzunar</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Narator</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Denumire nativă</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>Denumirea nativă a limbii cărții.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Fără copertă</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>Număr OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>Numărul OCLC al cărții.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>Identificatorul cărții pe Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Limba originală</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Codul limbii originale</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>Codul din două litere al limbii originale a cărții.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Denumirea limbii originale</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>Denumirea limbii originale a cărții.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Denumirea nativă a limbii originale</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>Denumirea nativă a limbii originale a cărții.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Data lansării originale</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>Data la care cartea a fost lansată inițial.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Anul lansării originale</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>Anul în care cartea a fost lansată inițial.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Titlu original</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>Titlul original al cărții, când diferă de cel actual.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Altul</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Număr de pagini</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>Numărul de pagini al cărții.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>Copertă broșată</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Carte pop-up</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Editură</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>Editura cărții.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Editură</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Rating maxim</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Ratinguri</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Ratingurile cărții din diferite surse.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Sursă</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Rating</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Număr de voturi</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Țara de lansare</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>Codul din două litere al țării de lansare.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Informații de lansare</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Versiunea lansării</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>Versiunea lansării, precum cea originală.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Elimină</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Data relansării</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>Data la care cartea a fost relansată.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Anul relansării</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>Anul în care cartea a fost relansată.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Categoria rolului</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Rol</value>
</data>
<data name="Save" xml:space="preserve">
<value>Salvează</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>Cartea nu a putut fi salvată.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Legare spirală</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Etichete</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Etichetele cărții, separate prin virgule.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Titlu</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>Titlul principal al cărții.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Broșat trade</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Traducător</value>
</data>
<data name="User" xml:space="preserve">
<value>Utilizator</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Număr volum</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>Numărul volumului cărții în cadrul seriei sale.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>ID Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>ID Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>ID LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>ID Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>ID Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN-uri</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Contribuitori</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>ID Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>Додати учасника</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>Додати оцінку</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>Додати</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>Ідентифікатор книги на Apple Books.</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>Стандартний ідентифікаційний номер Amazon книги.</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>Аудіокнига</value>
</data>
<data name="Author" xml:space="preserve">
<value>Автор</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Повернутися до бібліотеки</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>Ідентифікатор книги на Barnes &amp; Noble.</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>Картонна книга</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>Деталі книги</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>Книгу збережено.</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>Змінити обкладинку</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>Ім'я</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>Люди, які долучилися до створення книги, як-от її автори.</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>Зображення обкладинки</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>Зображення обкладинки оновлено.</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>Не вдалося завантажити зображення обкладинки.</value>
</data>
<data name="Description" xml:space="preserve">
<value>Опис</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>Короткий зміст або опис книги.</value>
</data>
<data name="eBook" xml:space="preserve">
<value>Електронна книга</value>
</data>
<data name="Edition" xml:space="preserve">
<value>Видання</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>Видання книги.</value>
</data>
<data name="Format" xml:space="preserve">
<value>Формат</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>Фізичний або цифровий формат книги.</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>Загальна інформація</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Жанри</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>Жанри книги, розділені комами.</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>Числовий ідентифікатор книги на Goodreads.</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>Ідентифікатор книги на Google Books.</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>Тверда палітурка</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>Ідентифікатори</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>Ілюстратор</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>Формат ISBN</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>Міжнародні стандартні номери книги (ISBN).</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>Значення ISBN</value>
</data>
<data name="Language" xml:space="preserve">
<value>Мова</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>Код мови</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>Дволітерний код мови книги.</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>Назва мови</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>Назва мови книги.</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>Великий шрифт</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>Контрольний номер Бібліотеки Конгресу книги.</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>Шкіряна палітурка</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>Бібліотечна палітурка</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>Ідентифікатор книги на LibraryThing.</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>Кишеньковий формат</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>Оповідач</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>Власна назва</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>Власна назва мови книги.</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>Без обкладинки</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>Номер OCLC</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>Номер OCLC книги.</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>Ідентифікатор книги на Open Library.</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>Оригінальна мова</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>Код оригінальної мови</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>Дволітерний код оригінальної мови книги.</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>Назва оригінальної мови</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>Назва оригінальної мови книги.</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>Власна назва оригінальної мови</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>Власна назва оригінальної мови книги.</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>Дата першого випуску</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>Дата першого випуску книги.</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>Рік першого випуску</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>Рік першого випуску книги.</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>Оригінальна назва</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>Оригінальна назва книги, якщо вона відрізняється від поточної.</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>Інше</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>Кількість сторінок</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>Кількість сторінок книги.</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>М'яка палітурка</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>Книга-панорама</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>Видавництво</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>Видавництво книги.</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>Видавництво</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>Максимальна оцінка</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>Оцінки</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>Оцінки книги з різних джерел.</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>Джерело</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>Оцінка</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>Кількість голосів</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>Країна випуску</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>Дволітерний код країни випуску.</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>Інформація про випуск</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>Версія випуску</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>Версія випуску, як-от оригінальна.</value>
</data>
<data name="Remove" xml:space="preserve">
<value>Видалити</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>Дата перевипуску</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>Дата перевипуску книги.</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>Рік перевипуску</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>Рік перевипуску книги.</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>Категорія ролі</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>Роль</value>
</data>
<data name="Save" xml:space="preserve">
<value>Зберегти</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>Не вдалося зберегти книгу.</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>Спіральна палітурка</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Теги</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>Теги книги, розділені комами.</value>
</data>
<data name="Title" xml:space="preserve">
<value>Назва</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>Основна назва книги.</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>Трейд-пап’пербек</value>
</data>
<data name="Translator" xml:space="preserve">
<value>Перекладач</value>
</data>
<data name="User" xml:space="preserve">
<value>Користувач</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>Номер тому</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>Номер тому книги в межах її серії.</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>ID на Apple Books</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>ID на Google Books</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>ID на LibraryThing</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>ID на Barnes &amp; Noble</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>ID на Open Library</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>Учасники</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>ID на Goodreads</value>
</data>
</root>
@@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddContributor" xml:space="preserve">
<value>添加贡献者</value>
</data>
<data name="AddRating" xml:space="preserve">
<value>添加评分</value>
</data>
<data name="AddRow" xml:space="preserve">
<value>添加</value>
</data>
<data name="AppleBooksIdDescription" xml:space="preserve">
<value>图书在 Apple Books 上的标识。</value>
</data>
<data name="ASINDescription" xml:space="preserve">
<value>图书的亚马逊标准识别号。</value>
</data>
<data name="Audiobook" xml:space="preserve">
<value>有声书</value>
</data>
<data name="Author" xml:space="preserve">
<value>作者</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>返回图书馆</value>
</data>
<data name="BarnesAndNobleIdDescription" xml:space="preserve">
<value>图书在 Barnes &amp; Noble 上的标识。</value>
</data>
<data name="BoardBook" xml:space="preserve">
<value>纸板书</value>
</data>
<data name="BookDetails" xml:space="preserve">
<value>图书详情</value>
</data>
<data name="BookSaved" xml:space="preserve">
<value>图书已保存。</value>
</data>
<data name="ChangeCover" xml:space="preserve">
<value>更换封面</value>
</data>
<data name="ContributorName" xml:space="preserve">
<value>姓名</value>
</data>
<data name="ContributorsDescription" xml:space="preserve">
<value>为图书作出贡献的人,例如其作者。</value>
</data>
<data name="CoverImage" xml:space="preserve">
<value>封面图片</value>
</data>
<data name="CoverSaved" xml:space="preserve">
<value>封面图片已更新。</value>
</data>
<data name="CoverUploadFailed" xml:space="preserve">
<value>无法上传封面图片。</value>
</data>
<data name="Description" xml:space="preserve">
<value>简介</value>
</data>
<data name="DescriptionDescription" xml:space="preserve">
<value>图书的简短摘要或简介。</value>
</data>
<data name="eBook" xml:space="preserve">
<value>电子书</value>
</data>
<data name="Edition" xml:space="preserve">
<value>版本</value>
</data>
<data name="EditionDescription" xml:space="preserve">
<value>图书的版本。</value>
</data>
<data name="Format" xml:space="preserve">
<value>格式</value>
</data>
<data name="FormatDescription" xml:space="preserve">
<value>图书的实体或数字格式。</value>
</data>
<data name="GeneralInformation" xml:space="preserve">
<value>常规信息</value>
</data>
<data name="Genres" xml:space="preserve">
<value>体裁</value>
</data>
<data name="GenresDescription" xml:space="preserve">
<value>图书的体裁,以逗号分隔。</value>
</data>
<data name="GoodreadsIdDescription" xml:space="preserve">
<value>图书在 Goodreads 上的数字标识。</value>
</data>
<data name="GoogleBooksIdDescription" xml:space="preserve">
<value>图书在 Google Books 上的标识。</value>
</data>
<data name="Hardcover" xml:space="preserve">
<value>精装本</value>
</data>
<data name="Identifiers" xml:space="preserve">
<value>标识符</value>
</data>
<data name="Illustrator" xml:space="preserve">
<value>插画师</value>
</data>
<data name="IsbnFormat" xml:space="preserve">
<value>ISBN 格式</value>
</data>
<data name="ISBNsDescription" xml:space="preserve">
<value>图书的国际标准书号(ISBN)。</value>
</data>
<data name="IsbnValue" xml:space="preserve">
<value>ISBN 值</value>
</data>
<data name="Language" xml:space="preserve">
<value>语言</value>
</data>
<data name="LanguageCode" xml:space="preserve">
<value>语言代码</value>
</data>
<data name="LanguageCodeDescription" xml:space="preserve">
<value>图书语言的两位代码。</value>
</data>
<data name="LanguageName" xml:space="preserve">
<value>语言名称</value>
</data>
<data name="LanguageNameDescription" xml:space="preserve">
<value>图书语言的名称。</value>
</data>
<data name="LargePrint" xml:space="preserve">
<value>大字版</value>
</data>
<data name="LCCNDescription" xml:space="preserve">
<value>图书的美国国会图书馆控制号。</value>
</data>
<data name="LeatherBound" xml:space="preserve">
<value>皮面装订</value>
</data>
<data name="LibraryBinding" xml:space="preserve">
<value>图书馆装订</value>
</data>
<data name="LibraryThingIdDescription" xml:space="preserve">
<value>图书在 LibraryThing 上的标识。</value>
</data>
<data name="MassMarketPaperback" xml:space="preserve">
<value>大众平装本</value>
</data>
<data name="Narrator" xml:space="preserve">
<value>叙述者</value>
</data>
<data name="NativeName" xml:space="preserve">
<value>本地语名称</value>
</data>
<data name="NativeNameDescription" xml:space="preserve">
<value>图书语言的本地语名称。</value>
</data>
<data name="NoCover" xml:space="preserve">
<value>无封面</value>
</data>
<data name="OCLCNumber" xml:space="preserve">
<value>OCLC 编号</value>
</data>
<data name="OCLCNumberDescription" xml:space="preserve">
<value>图书的 OCLC 编号。</value>
</data>
<data name="OpenLibraryIdDescription" xml:space="preserve">
<value>图书在 Open Library 上的标识。</value>
</data>
<data name="OriginalLanguage" xml:space="preserve">
<value>原语言</value>
</data>
<data name="OriginalLanguageCode" xml:space="preserve">
<value>原语言代码</value>
</data>
<data name="OriginalLanguageCodeDescription" xml:space="preserve">
<value>图书原语言的两位代码。</value>
</data>
<data name="OriginalLanguageName" xml:space="preserve">
<value>原语言名称</value>
</data>
<data name="OriginalLanguageNameDescription" xml:space="preserve">
<value>图书原语言的名称。</value>
</data>
<data name="OriginalLanguageNativeName" xml:space="preserve">
<value>原语言本地语名称</value>
</data>
<data name="OriginalLanguageNativeNameDescription" xml:space="preserve">
<value>图书原语言的本地语名称。</value>
</data>
<data name="OriginalReleaseDate" xml:space="preserve">
<value>首次发行日期</value>
</data>
<data name="OriginalReleaseDateDescription" xml:space="preserve">
<value>图书首次发行的日期。</value>
</data>
<data name="OriginalReleaseYear" xml:space="preserve">
<value>首次发行年份</value>
</data>
<data name="OriginalReleaseYearDescription" xml:space="preserve">
<value>图书首次发行的年份。</value>
</data>
<data name="OriginalTitle" xml:space="preserve">
<value>原标题</value>
</data>
<data name="OriginalTitleDescription" xml:space="preserve">
<value>图书的原标题,如果与当前标题不同。</value>
</data>
<data name="OtherRole" xml:space="preserve">
<value>其他</value>
</data>
<data name="PageCount" xml:space="preserve">
<value>页数</value>
</data>
<data name="PageCountDescription" xml:space="preserve">
<value>图书的页数。</value>
</data>
<data name="Paperback" xml:space="preserve">
<value>平装本</value>
</data>
<data name="PopupBook" xml:space="preserve">
<value>立体书</value>
</data>
<data name="Publisher" xml:space="preserve">
<value>出版社</value>
</data>
<data name="PublisherDescription" xml:space="preserve">
<value>图书的出版社。</value>
</data>
<data name="PublisherRole" xml:space="preserve">
<value>出版者</value>
</data>
<data name="RatingMaxValue" xml:space="preserve">
<value>最高评分</value>
</data>
<data name="Ratings" xml:space="preserve">
<value>评分</value>
</data>
<data name="RatingsDescription" xml:space="preserve">
<value>不同来源对图书的评分。</value>
</data>
<data name="RatingSource" xml:space="preserve">
<value>来源</value>
</data>
<data name="RatingValue" xml:space="preserve">
<value>评分</value>
</data>
<data name="RatingVoteCount" xml:space="preserve">
<value>票数</value>
</data>
<data name="ReleaseCountry" xml:space="preserve">
<value>发行国家</value>
</data>
<data name="ReleaseCountryDescription" xml:space="preserve">
<value>发行国家的两位代码。</value>
</data>
<data name="ReleaseInformation" xml:space="preserve">
<value>发行信息</value>
</data>
<data name="ReleaseVersion" xml:space="preserve">
<value>发行版本</value>
</data>
<data name="ReleaseVersionDescription" xml:space="preserve">
<value>发行版本,例如原版。</value>
</data>
<data name="Remove" xml:space="preserve">
<value>移除</value>
</data>
<data name="ReReleaseDate" xml:space="preserve">
<value>再发行日期</value>
</data>
<data name="ReReleaseDateDescription" xml:space="preserve">
<value>图书再次发行的日期。</value>
</data>
<data name="ReReleaseYear" xml:space="preserve">
<value>再发行年份</value>
</data>
<data name="ReReleaseYearDescription" xml:space="preserve">
<value>图书再次发行的年份。</value>
</data>
<data name="RoleCategory" xml:space="preserve">
<value>角色类别</value>
</data>
<data name="RoleName" xml:space="preserve">
<value>角色</value>
</data>
<data name="Save" xml:space="preserve">
<value>保存</value>
</data>
<data name="SaveFailed" xml:space="preserve">
<value>无法保存图书。</value>
</data>
<data name="SpiralBound" xml:space="preserve">
<value>螺旋装订</value>
</data>
<data name="Tags" xml:space="preserve">
<value>标签</value>
</data>
<data name="TagsDescription" xml:space="preserve">
<value>图书的标签,以逗号分隔。</value>
</data>
<data name="Title" xml:space="preserve">
<value>标题</value>
</data>
<data name="TitleDescription" xml:space="preserve">
<value>图书的主标题。</value>
</data>
<data name="TradePaperback" xml:space="preserve">
<value>贸易平装本</value>
</data>
<data name="Translator" xml:space="preserve">
<value>译者</value>
</data>
<data name="User" xml:space="preserve">
<value>用户</value>
</data>
<data name="VolumeNumber" xml:space="preserve">
<value>卷号</value>
</data>
<data name="VolumeNumberDescription" xml:space="preserve">
<value>图书在其系列中的卷号。</value>
</data>
<data name="Isbn13" xml:space="preserve">
<value>ISBN-13</value>
</data>
<data name="LCCN" xml:space="preserve">
<value>LCCN</value>
</data>
<data name="Calibre" xml:space="preserve">
<value>Calibre</value>
</data>
<data name="AppleBooksId" xml:space="preserve">
<value>Apple Books ID</value>
</data>
<data name="OpenLibrary" xml:space="preserve">
<value>Open Library</value>
</data>
<data name="GoogleBooks" xml:space="preserve">
<value>Google Books</value>
</data>
<data name="ASIN" xml:space="preserve">
<value>ASIN</value>
</data>
<data name="Isbn10" xml:space="preserve">
<value>ISBN-10</value>
</data>
<data name="GoogleBooksId" xml:space="preserve">
<value>Google Books ID</value>
</data>
<data name="LibraryThingId" xml:space="preserve">
<value>LibraryThing ID</value>
</data>
<data name="Goodreads" xml:space="preserve">
<value>Goodreads</value>
</data>
<data name="Amazon" xml:space="preserve">
<value>Amazon</value>
</data>
<data name="BarnesAndNobleId" xml:space="preserve">
<value>Barnes &amp; Noble ID</value>
</data>
<data name="OpenLibraryId" xml:space="preserve">
<value>Open Library ID</value>
</data>
<data name="ISBNs" xml:space="preserve">
<value>ISBN</value>
</data>
<data name="Contributors" xml:space="preserve">
<value>贡献者</value>
</data>
<data name="GoodreadsId" xml:space="preserve">
<value>Goodreads ID</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>قارئ الكتب الذي يفتح هذا الكتاب معطل لهذه المكتبة. قم بتمكينه في إعدادات المكتبة لقراءة الكتاب.</value>
</data>
<data name="BackToLibrary" 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>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Zurück zur Bibliothek</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Volver a la biblioteca</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Retour à la bibliothèque</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Torna alla biblioteca</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>この本を開くブックリーダーは、このライブラリで無効になっています。ライブラリ設定で有効にすると本を読めます。</value>
</data>
<data name="BackToLibrary" 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>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<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>
<data name="BackToLibrary" xml:space="preserve">
<value>Înapoi la bibliotecă</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>Читач книг, який відкриває цю книгу, вимкнено для цієї бібліотеки. Увімкніть його в налаштуваннях бібліотеки, щоб читати книгу.</value>
</data>
<data name="BackToLibrary" 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>
<!--
Microsoft ResX Schema
@@ -147,4 +147,7 @@
<data name="ReaderDisabled" xml:space="preserve">
<value>打开此图书的图书阅读器已在此媒体库中禁用。在媒体库设置中启用它即可阅读该图书。</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>返回图书馆</value>
</data>
</root>
@@ -11,7 +11,7 @@
var roles = ViewData["roles"] as RoleDto[];
var users = ViewData["users"] as UserDto[];
var permissions = ViewData["permissions"] as PermissionDto[];
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -24,7 +24,7 @@
<div id="authorization-permissions-container">
<input type="hidden" name="authorization-users-selected-id" id="authorization-users-selected-id" value="" />
<input type="hidden" name="authorization-roles-selected-id" id="authorization-roles-selected-id" value="" />
<!-- Users dropdown row -->
<!-- Users dropdown row. -->
<div class="h-30px w-100 text-end mb-5">
<label for="authorization-users-combobox" class="text-light-one">@_localizer["Users"]</label>
@@ -48,7 +48,7 @@
</div>
</div>
<!-- Roles dropdown row -->
<!-- Roles dropdown row. -->
<div class="h-30px w-100 text-end mb-5">
<label for="authorization-roles-combobox" class="text-light-one">@_localizer["Roles"]</label>
@@ -72,7 +72,7 @@
</div>
</div>
<!-- Permissions row -->
<!-- Permissions row. -->
<div id="authorization-permissions-permissions-container" class="">
<div id="authorization-permissions-permissions">
<div id="authorization-permissions-permissions-scroll" class="scroll-horizontal">
@@ -95,7 +95,7 @@
</div>
</div>
<!-- Submit Button Row -->
<!-- Submit Button Row. -->
<div class="w-100 h-25px mt-5 text-end">
<button id="btn-update-user" type="submit" class="confirm-button f-14 h-24px v-align-t" disabled>@_localizer["Update"]</button>
</div>
@@ -105,9 +105,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const btnUpdateUser = document.getElementById('btn-update-user');
const form = document.getElementById('authorization-permissions-form');
const rolesDropdown = document.getElementById('authorization-roles-combobox-dropdown');
@@ -115,7 +116,7 @@
const roleIdInput = document.getElementById('authorization-roles-selected-id');
const userIdInput = document.getElementById('authorization-users-selected-id');
// update user permissions and role
// Update user permissions and role.
async function handleUserAuthorizationSubmitAsync() {
const formData = {
userId: userIdInput.value,
@@ -131,7 +132,7 @@
async function fetchUserRoleAsync(userId) {
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Admin.GET_ROLE_BY_USER_ID, new { userId = default(Guid) })';
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${userId}`)); // userId needs to be replaced here, because GetAbsoluteUrl is server side, userId is client side
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${userId}`)); // userId needs to be replaced here, because GetAbsoluteUrl is server side, userId is client side.
if (data) {
var roleElement = document.querySelector('#authorization-roles-combobox .enlightenment-option[data-value="' + data.id + '"]');
var roleName = roleElement.textContent;
@@ -143,13 +144,13 @@
async function fetchUserPermissionsAsync(userId) {
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Admin.GET_PERMISSIONS_BY_USER_ID, new { userId = default(Guid) })';
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${userId}`)); // userId needs to be replaced here, because GetAbsoluteUrl is server side, userId is client side
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${userId}`)); // userId needs to be replaced here, because GetAbsoluteUrl is server side, userId is client side.
if (data) {
// clear all checkboxes
// Clear all checkboxes.
document.querySelectorAll("input[name='authorization-permissions-permissions']")
.forEach(input => input.checked = false);
// check the checkboxes for which permissions are assigned
// Check the checkboxes for which permissions are assigned.
data.forEach(p => {
const checkbox = document.querySelector(`input[name='authorization-permissions-permissions'][value='${p.id}']`);
if (checkbox)
@@ -158,7 +159,7 @@
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -166,15 +167,15 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleUserAuthorizationSubmitAsync();
};
// on document click
// On document click.
const handleDocumentClick = async function(e) {
// users dropdown change
// Users dropdown change.
if (e.target.closest('#authorization-users-combobox .enlightenment-option')) {
var selectedUserId = e.target.dataset.value;
document.querySelector('#authorization-roles-combobox .enlightenment-selected-text').textContent = '@_localizer["SelectARole"]';
@@ -190,26 +191,26 @@
else
btnUpdateUser.disabled = true;
}
// roles dropdown change
// Roles dropdown change.
else if (e.target.closest('#authorization-roles-combobox .enlightenment-option')) {
const roleId = e.target.dataset.value;
roleIdInput.value = roleId || '';
}
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
document.addEventListener('click', handleDocumentClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
document.removeEventListener('click', handleDocumentClick);
});
// when form's height changes, adjust the roles combobox dropdown maximum height accordingly, so it doesn't cause an <article> section overflow
// When form's height changes, adjust the roles combobox dropdown maximum height accordingly, so it doesn't cause an <article> section overflow.
const resizeObserver = new ResizeObserver(entries => {
const formHeight = form.getBoundingClientRect().height;
usersDropdown.style.maxHeight = `calc(${formHeight}px - 50px)`;
@@ -219,12 +220,12 @@
});
resizeObserver.observe(form);
// register cleanup for observer
// Register cleanup for observer.
cleanupFunctions.push(() => {
resizeObserver.disconnect();
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -9,7 +9,7 @@
@{
var roles = ViewData["roles"] as RoleDto[];
var permissions = ViewData["permissions"] as PermissionDto[];
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -21,7 +21,7 @@
<form id="authorization-roles-form" method="post" class="w-100 h-100 mx-auto pl-10 pr-10 pt-10 pb-10">
<div id="authorization-roles-container">
<input type="hidden" name="authorization-roles-selected-id" id="authorization-roles-selected-id" value="" />
<!-- Roles dropdown row -->
<!-- Roles dropdown row. -->
<div class="h-30px w-100 text-end mb-5">
<label for="authorization-roles-combobox" class="text-light-one">@_localizer["Roles"]</label>
@@ -45,13 +45,13 @@
</div>
</div>
<!-- Role name input row -->
<!-- Role name input row. -->
<div class="h-30px w-100 text-end mb-5">
<label for="txt-role-name" class="text-light-one">@_localizer["RoleName"]</label>
<input type="text" id="txt-role-name" name="authorization-role-name" class="enlightenment-input w-250px" />
</div>
<!-- Permissions row -->
<!-- Permissions row. -->
<div id="authorization-roles-permissions-container" class="">
<div id="authorization-roles-permissions">
<div id="authorization-roles-permissions-scroll" class="scroll-horizontal">
@@ -74,7 +74,7 @@
</div>
</div>
<!-- Submit Button Row -->
<!-- Submit Button Row. -->
<div class="w-100 h-25px mt-5 text-end">
<button id="btn-delete-role" type="button" class="abort-button f-14 h-24px v-align-t hidden">@_localizer["DeleteRole"]</button>
<button id="btn-confirm-role" type="submit" class="confirm-button f-14 h-24px v-align-t">@_localizer["CreateRole"]</button>
@@ -85,9 +85,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const btnDeleteRole = document.getElementById('btn-delete-role');
const btnConfirmRole = document.getElementById('btn-confirm-role');
const txtRoleName = document.getElementById('txt-role-name');
@@ -95,7 +96,7 @@
const dropdown = document.getElementById('authorization-roles-combobox-dropdown');
const roleIdInput = document.getElementById('authorization-roles-selected-id');
// create new or update existing role
// Create new or update existing role.
async function handleRoleSubmitAsync() {
const formData = {
roleId: roleIdInput.value,
@@ -118,14 +119,14 @@
async function fetchRolesAsync() {
const data = await callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.Admin.GET_ROLES)');
if (data) {
// clear the roles drop down list
// Clear the roles drop down list.
const rolesDropdown = document.querySelector("#authorization-roles-combobox .enlightenment-dropdown");
rolesDropdown.innerHTML = `
<div class="shine-effect" style="top: -4px;"></div>
<div class="enlightenment-option first-option disabled">'@_localizer["SelectARole"]'</div>
`;
// populate the roles drop down
// Populate the roles drop down.
data.forEach((role, index) => {
const option = document.createElement('div');
option.className = `enlightenment-option ${index === data.length - 1 ? 'last-option' : ''}`;
@@ -134,21 +135,21 @@
rolesDropdown.appendChild(option);
});
// update the text of the toggle button of the combobox
// Update the text of the toggle button of the combobox.
document.querySelector('.enlightenment-selected-text').textContent = '@_localizer["SelectARole"]';
// all permissions should be "unchecked"
// All permissions should be "unchecked".
document.querySelectorAll("input[name='authorization-role-permissions']")
.forEach(input => input.checked = false);
// the delete button should be hidden
// The delete button should be hidden.
btnDeleteRole.classList.remove('inline');
btnDeleteRole.classList.add('hidden');
// the "update" button should be "create"
// The "update" button should be "create".
btnConfirmRole.textContent = '@_localizer["CreateRole"]';
// the input for the role name should also have its text emptied
// The input for the role name should also have its text emptied.
txtRoleName.value = '';
}
}
@@ -156,13 +157,13 @@
async function fetchRolePermissionsAsync(roleId) {
if (roleId) {
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Admin.GET_PERMISSIONS_BY_ROLE_ID, new { roleId = default(Guid) })';
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${roleId}`)); // roleId needs to be replaced here, because GetAbsoluteUrl is server side, roleId is client side
const data = await callApiGetAsync(url.replace('/@(default(Guid))', `/${roleId}`)); // roleId needs to be replaced here, because GetAbsoluteUrl is server side, roleId is client side.
if (data) {
// clear all checkboxes
// Clear all checkboxes.
document.querySelectorAll("input[name='authorization-role-permissions']")
.forEach(input => input.checked = false);
// check the checkboxes for which permissions are assigned
// Check the checkboxes for which permissions are assigned.
data.permissions.forEach(p => {
const checkbox = document.querySelector(
`input[name='authorization-role-permissions'][value='${p.id}']`
@@ -171,13 +172,13 @@
});
}
} else {
// if no role is selected, clear checkboxes
// If no role is selected, clear checkboxes.
document.querySelectorAll("input[name='authorization-role-permissions']")
.forEach(input => input.checked = false);
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -185,18 +186,18 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleRoleSubmitAsync();
};
// on delete role button click
// On delete role button click.
const handleBtnDeleteRoleClick = async function(e) {
// ask the user for confirmation before deleting the role
// Ask the user for confirmation before deleting the role.
if (await dialogService.show('@_localizer["DeleteRoleConfirm"]', jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Admin.DELETE_ROLE, new { roleId = default(Guid) })';
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${roleIdInput.value}`)); // roleId needs to be replaced here, because GetAbsoluteUrl is server side, roleId is client side
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${roleIdInput.value}`)); // roleId needs to be replaced here, because GetAbsoluteUrl is server side, roleId is client side.
if (success) {
await fetchRolesAsync();
notificationService.show('@_localizer["RoleDeleted"]', NotificationType.SUCCESS);
@@ -204,9 +205,9 @@
}
};
// on document click
// On document click.
const handleDocumentClick = async function(e) {
// roles dropdown change
// Roles dropdown change.
if (e.target.closest('#authorization-roles-combobox .enlightenment-option')) {
const roleId = e.target.dataset.value;
const selectedText = e.target.textContent;
@@ -228,13 +229,13 @@
}
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
btnDeleteRole.addEventListener('click', handleBtnDeleteRoleClick);
document.addEventListener('click', handleDocumentClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
@@ -242,7 +243,7 @@
document.removeEventListener('click', handleDocumentClick);
});
// when form's height changes, adjust the roles combobox dropdown maximum height accordingly, so it doesn't cause an <article> section overflow
// When form's height changes, adjust the roles combobox dropdown maximum height accordingly, so it doesn't cause an <article> section overflow.
const resizeObserver = new ResizeObserver(entries => {
const formHeight = form.getBoundingClientRect().height;
dropdown.style.maxHeight = `calc(${formHeight}px - 50px)`;
@@ -250,12 +251,12 @@
});
resizeObserver.observe(form);
// register cleanup for observer
// Register cleanup for observer.
cleanupFunctions.push(() => {
resizeObserver.disconnect();
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -11,7 +11,7 @@
@{
var settingsByPluginId = ViewData["pluginSettings"] as Dictionary<Guid, PluginSettingsDto> ?? new Dictionary<Guid, PluginSettingsDto>();
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -20,8 +20,8 @@
@Html.AntiForgeryToken()
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"><!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect mx-auto panel w-75 mb-10" style="min-width: 320px;">
<div class="shine-effect"></div>
<div class="form-row">
@@ -150,10 +150,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// on settings toggle button click, show/hide the settings row of the plugin
// On settings toggle button click, show/hide the settings row of the plugin.
const handleSettingsToggleClick = function(e) {
if (e.target.matches('.btn-plugin-settings-toggle')) {
const row = e.target.closest('tr');
@@ -164,7 +164,7 @@
}
};
// on save plugin settings button click, collect the settings of the panel and send them to the API
// On save plugin settings button click, collect the settings of the panel and send them to the API.
const handleSavePluginSettingsClick = async function(e) {
if (e.target.matches('.btn-save-plugin-settings')) {
const panel = e.target.closest('.plugin-settings-panel');
@@ -186,11 +186,12 @@
}
};
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const uploadButton = document.getElementById('btn-upload-plugin');
const uploadInput = document.getElementById('plugin-upload-input');
const installUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Plugins.INSTALL_PLUGIN)';
// uploads the selected plugin archive as a multipart request, keeping the antiforgery token
// Uploads the selected plugin archive as a multipart request, keeping the antiforgery token.
async function handleUploadInputChange() {
const file = uploadInput.files[0];
if (!file)
@@ -211,18 +212,18 @@
}
}
// opens the file picker when the upload button is clicked
// Opens the file picker when the upload button is clicked.
function handleUploadButtonClick() {
uploadInput.click();
}
// add listeners
// Add listeners.
document.addEventListener('click', handleSettingsToggleClick);
document.addEventListener('click', handleSavePluginSettingsClick);
uploadButton.addEventListener('click', handleUploadButtonClick);
uploadInput.addEventListener('change', handleUploadInputChange);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
document.removeEventListener('click', handleSettingsToggleClick);
document.removeEventListener('click', handleSavePluginSettingsClick);
@@ -230,7 +231,7 @@
uploadInput.removeEventListener('change', handleUploadInputChange);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -198,6 +198,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
CleanScheduledJobExecutionHistory: '#ba68c8'
};
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const jobsTable = document.getElementById('scheduler-jobs-table');
const jobsTableBody = jobsTable.querySelector('tbody');
const legend = document.getElementById('scheduler-legend');
@@ -236,8 +237,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
return selected ? (selected.getAttribute('data-value') || '') : '';
}
// Binds the change of a themed combobox to a callback, so the page reacts to a selection the same way it did to
// the change event of a native select.
// Binds the change of a themed combobox to a callback, so the page reacts to a selection the same way it did to the change event of a native select.
function bindComboboxChange(combobox, onChange) {
const handler = event => {
const option = event.target.closest('.enlightenment-option');
@@ -313,7 +313,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
let isInitialized = false;
//+----------------------------------------------------------------------------------------+
// | Rendering |.
//| Rendering |
//+----------------------------------------------------------------------------------------+
// The API stores the execution and job timestamps in UTC, but the persistence medium (SQLite) stores them as
@@ -434,13 +434,12 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
//+----------------------------------------------------------------------------------------+
// | Graph |.
//| Graph |
//+----------------------------------------------------------------------------------------+
function resizeGraph() {
// The graph fills the width of its container next to the legend, and its height follows the legend,
// with a sensible floor; the height must not be derived from the canvas element box, because the flex
// layout stretches the canvas and its replaced-element aspect ratio would blow the box up.
// The graph fills the width of its container next to the legend, and its height follows the legend, with a sensible floor; the height must not be derived
from the canvas element box, because the flex layout stretches the canvas and its replaced-element aspect ratio would blow the box up.
const container = graphCanvas.parentElement;
if (!container || container.clientWidth <= 0)
return;
@@ -613,7 +612,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
//+----------------------------------------------------------------------------------------+
// | Data loading |.
//| Data loading |
//+----------------------------------------------------------------------------------------+
async function loadJobsAsync() {
@@ -649,7 +648,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
//+----------------------------------------------------------------------------------------+
// | Job actions |.
//| Job actions |
//+----------------------------------------------------------------------------------------+
async function executeJobActionAsync(url, successMessage) {
@@ -707,7 +706,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
//+----------------------------------------------------------------------------------------+
// | SignalR |.
//| SignalR |
//+----------------------------------------------------------------------------------------+
async function getAccessTokenAsync() {
@@ -744,7 +743,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
//+----------------------------------------------------------------------------------------+
// | Initialization |.
//| Initialization |
//+----------------------------------------------------------------------------------------+
async function initialize() {
@@ -10,7 +10,7 @@
@{
var themes = ViewData["themes"] as IReadOnlyList<ThemeInfoDto>;
var currentThemeId = ViewData["currentThemeId"] as string;
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
int bundledThemeCount = 0;
if (themes is not null)
@@ -147,25 +147,26 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
let isInitialized = false;
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const uploadButton = document.getElementById('btn-upload-theme');
const uploadInput = document.getElementById('theme-upload-input');
const installUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Themes.INSTALL_THEME)';
// reloads the page after a theme mutation, so the new theme state and the themed shell are re-rendered
// Reloads the page after a theme mutation, so the new theme state and the themed shell are re-rendered.
function reloadPage() {
window.location.reload();
}
// refreshes the current page content without reloading the page, so the media player keeps playing
// Refreshes the current page content without reloading the page, so the media player keeps playing.
function refreshPageContent() {
updateContentAsync(window.location.href, false);
}
// activates the theme of the clicked row
// Activates the theme of the clicked row.
async function handleActivateClick(event) {
const button = event.target.closest('.activate-theme-button');
if (!button)
@@ -174,7 +175,7 @@
reloadPage();
}
// deletes the theme of the clicked row after confirmation
// Deletes the theme of the clicked row after confirmation.
async function handleDeleteClick(event) {
const button = event.target.closest('.delete-theme-button');
if (!button)
@@ -185,31 +186,31 @@
}
}
// restores the soft deleted bundled theme of the clicked row
// Restores the soft deleted bundled theme of the clicked row.
async function handleRestoreClick(event) {
const button = event.target.closest('.restore-theme-button');
if (!button)
return;
// an empty JSON body is sent so the antiforgery-protected POST request binds the route theme id without a JsonException
// An empty JSON body is sent so the antiforgery-protected POST request binds the route theme id without a JsonException.
await callApiPostAsync(button.dataset.url, {});
refreshPageContent();
}
// downloads the archive of the theme of the clicked row
// Downloads the archive of the theme of the clicked row.
function handleDownloadClick(event) {
const button = event.target.closest('.download-theme-button');
if (button)
window.location.href = button.dataset.url;
}
// opens the image viewer with the preview of the clicked theme
// Opens the image viewer with the preview of the clicked theme.
function handlePreviewClick(event) {
const button = event.target.closest('.theme-preview-button');
if (button)
imageViewer.open([{ src: button.dataset.previewUrl, title: button.dataset.previewTitle }]);
}
// falls back to the placeholder image when the preview of a theme is missing or fails to load
// Falls back to the placeholder image when the preview of a theme is missing or fails to load.
function attachPreviewErrorFallbacks() {
const placeholderUrl = '@Url.Content("~/admin/theme-placeholder.svg")';
document.querySelectorAll('.theme-preview-thumb').forEach(img => {
@@ -221,7 +222,7 @@
}
attachPreviewErrorFallbacks();
// uploads the selected theme archive as a multipart request, keeping the antiforgery token
// Uploads the selected theme archive as a multipart request, keeping the antiforgery token.
async function handleUploadInputChange() {
const file = uploadInput.files[0];
if (!file)
@@ -240,12 +241,12 @@
notificationService.show('@_localizer["UploadFailed"]', NotificationType.ERROR);
}
// opens the file picker when the upload button is clicked
// Opens the file picker when the upload button is clicked.
function handleUploadButtonClick() {
uploadInput.click();
}
// add listeners
// Add listeners.
uploadButton.addEventListener('click', handleUploadButtonClick);
uploadInput.addEventListener('change', handleUploadInputChange);
document.addEventListener('click', handleActivateClick);
@@ -254,7 +255,7 @@
document.addEventListener('click', handleRestoreClick);
document.addEventListener('click', handlePreviewClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
uploadButton.removeEventListener('click', handleUploadButtonClick);
uploadInput.removeEventListener('change', handleUploadInputChange);
@@ -265,7 +266,7 @@
document.removeEventListener('click', handlePreviewClick);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -7,7 +7,7 @@
@using Microsoft.AspNetCore.Mvc.Localization
@{
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -16,15 +16,15 @@
@model ChangePasswordRequest
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"><!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect p-2 mx-auto panel w-55 mb-10" style="min-width: 320px; margin-top: 1rem;">
<div class="shine-effect"></div>
<form method="post" id="change-password-form" class="inline">
@Html.AntiForgeryToken()
<input type="text" name="username" autocomplete="username" value="@User.Identity!.Name" hidden />
<div class="form-container">
<!-- Current Password -->
<!-- Current Password. -->
<div class="form-row" id="div-current-password">
<div class="form-label">
<label asp-for="CurrentPassword">@_localizer["CurrentPassword"]</label>
@@ -35,7 +35,7 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionCurrentPassword"]</small>
</div>
<!-- New Password -->
<!-- New Password. -->
<div class="form-row" id="div-new-password">
<div class="form-label">
<label asp-for="NewPassword">@_localizer["NewPassword"]</label>
@@ -46,7 +46,7 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionNewPassword"]</small>
</div>
<!-- New Password Confirm-->
<!-- New Password Confirm. -->
<div class="form-row" id="div-new-password-confirm">
<div class="form-label">
<label asp-for="NewPasswordConfirm">@_localizer["NewPasswordConfirm"]</label>
@@ -62,7 +62,7 @@
</div>
</div>
</form>
<!-- section registration success -->
<!-- Section registration success. -->
<div class="text-center w-100">
<p id="change-password-success" class="text-light-one w-100 hidden">@_localizer["PasswordChanged"]</p>
</div>
@@ -71,9 +71,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const form = document.getElementById('change-password-form');
const txtCurrentPassword = form.querySelector('[name="CurrentPassword"]');
const txtNewPassword = form.querySelector('[name="NewPassword"]');
@@ -85,7 +86,7 @@
const divNewPasswordConfirm = document.getElementById('div-new-password-confirm');
const divChangePasswordSubmit = document.getElementById('div-change-password-submit');
// perform the password change
// Perform the password change.
async function handleChangePasswordAsync() {
const formData = {
CurrentPassword: txtCurrentPassword.value,
@@ -102,7 +103,7 @@
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -110,23 +111,23 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleChangePasswordAsync();
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -7,7 +7,7 @@
@using Microsoft.AspNetCore.Mvc.Localization
@{
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -16,15 +16,15 @@
@model LoginRequest
<div style="display: grid; grid-template-rows: auto 1fr;"> <!--container with two rows, one fixed, one filling remaining space-->
<div style ="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"> <!-- Container with two rows, one fixed, one filling remaining space. -->
<div style ="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect p-2 mx-auto panel w-50 mb-10" style="min-width: 320px;">
<div class="shine-effect"></div>
<form method="post" id="login-form" class="inline">
@Html.AntiForgeryToken()
<input type="hidden" name="ReturnUrl" value="@ViewData["ReturnUrl"]" />
<div class="form-container">
<!-- Username -->
<!-- Username. -->
<div class="form-row">
<div class="form-label">
<label asp-for="Username">@_localizer["Username"]</label>:
@@ -33,7 +33,7 @@
<input asp-for="Username" autocomplete="username" class="enlightenment-input" />
</div>
</div>
<!-- Password -->
<!-- Password. -->
<div class="form-row">
<div class="form-label">
<label asp-for="Password">@_localizer["Password"]</label>:
@@ -46,7 +46,7 @@
<button id="btn-recover-password" type="button" class="abort-button h-22px">@_localizer["RecoverPassword"]</button>
<button id="btn-login" type="submit" class="confirm-button h-22px">@_localizer["LoginKey"]</button>
</div>
<!-- 2FA -->
<!-- 2FA. -->
<div class="form-row mt-10 hidden" id="div-totp-code">
<div class="form-label">
<label asp-for="TotpCode">@_localizer["TotpCode"]</label>
@@ -65,9 +65,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const form = document.getElementById('login-form');
const returnUrlInput = form.querySelector('[name="ReturnUrl"]');
const txtUsername = form.querySelector('[name="Username"]');
@@ -78,7 +79,7 @@
const btnRecoverPassword = document.getElementById('btn-recover-password');
const btnValidateTotp = document.getElementById('btn-validate-totp');
// perform the authentication
// Perform the authentication.
async function handleLoginAsync() {
const formData = {
Username: txtUsername.value,
@@ -100,7 +101,7 @@
window.location.href = data;
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -108,30 +109,30 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleLoginAsync();
};
// on recover password button click
// On recover password button click.
const handleBtnRecoverPasswordClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.Authentication.RECOVER_PASSWORD_VIEW)';
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
btnRecoverPassword.addEventListener('click', handleBtnRecoverPasswordClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
btnRecoverPassword.removeEventListener('click', handleBtnRecoverPasswordClick);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -7,7 +7,7 @@
@using Microsoft.AspNetCore.Mvc.Localization
@{
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -16,14 +16,14 @@
@model RecoverPasswordRequest
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"><!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect p-2 mx-auto panel w-50 mb-10" style="min-width: 320px;">
<div class="shine-effect"></div>
<form method="post" id="recover-password-form" class="inline">
@Html.AntiForgeryToken()
<div class="form-container">
<!-- Username -->
<!-- Username. -->
<div class="form-row" id="div-username">
<div class="form-label">
<label asp-for="Username">@_localizer["Username"]</label>
@@ -33,7 +33,7 @@
<input asp-for="Username" autocomplete="username" class="enlightenment-input" />
</div>
</div>
<!-- 2FA -->
<!-- 2FA. -->
<div class="form-row" id="div-totp-code">
<div class="form-label">
<label asp-for="TotpCode">@_localizer["TotpCode"]</label>
@@ -49,7 +49,7 @@
</div>
</div>
</form>
<!-- section registration success -->
<!-- Section registration success. -->
<div class="text-center w-100">
<p id="recover-password-success" class="text-light-one w-100 hidden">@_localizer["PasswordTemporarilyReset"]</p>
<button id="btn-redirect-login" type="submit" class="confirm-button h-22px hidden">@_localizer["Login"]</button>
@@ -59,9 +59,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const form = document.getElementById('recover-password-form');
const txtUsername = form.querySelector('[name="Username"]');
const txtTotpCode = form.querySelector('[name="TotpCode"]');
@@ -72,7 +73,7 @@
const divUsername = document.getElementById('div-username');
const divTotpCode = document.getElementById('div-totp-code');
// perform the password recovery
// Perform the password recovery.
async function handleRecoverPasswordAsync() {
const formData = {
Username: txtUsername.value,
@@ -89,7 +90,7 @@
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -97,29 +98,29 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleRecoverPasswordAsync();
};
// on login button click
// On login button click.
const handleBtnLoginClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.Authentication.LOGIN_VIEW)';
};
// on login redirect button click
// On login redirect button click.
const handleBtnRedirectLoginClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.Authentication.LOGIN_VIEW)';
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
btnLogin.addEventListener('click', handleBtnLoginClick);
btnRedirectLogin.addEventListener('click', handleBtnRedirectLoginClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
@@ -127,7 +128,7 @@
btnRedirectLogin.removeEventListener('click', handleBtnRedirectLoginClick);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -8,7 +8,7 @@
@{
string? registrationType = ViewData["RegistrationType"] as string;
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -17,13 +17,13 @@
@model RegisterRequest
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"><!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect p-2 mx-auto panel w-50 mb-10" style="min-width: 320px;">
<div class="shine-effect"></div>
<form method="post" id="register-account-form" class="inline">
@Html.AntiForgeryToken()
<!-- section for determining registration type (regular user/admin) -->
<!-- Section for determining registration type (regular user/admin). -->
<input type="hidden" name="RegistrationType" value="@registrationType" />
<div class="form-container">
@if (registrationType == "Admin")
@@ -32,7 +32,7 @@
<p class="invalid-feedback w-95 text-center f-18">@_localizer["AdminAccountRegistration"]</p>
</div>
}
<!-- Username -->
<!-- Username. -->
<div class="form-row">
<div class="form-label">
<label asp-for="Username">@_localizer["Username"]</label>
@@ -43,7 +43,7 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionUsername"]</small>
</div>
<!-- Password -->
<!-- Password. -->
<div class="form-row">
<div class="form-label">
<label asp-for="Password">@_localizer["Password"]</label>
@@ -54,7 +54,7 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionPassword"]</small>
</div>
<!-- Password Confirm-->
<!-- Password Confirm. -->
<div class="form-row">
<div class="form-label">
<label asp-for="PasswordConfirm">@_localizer["PasswordConfirm"]</label>
@@ -65,7 +65,7 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionPasswordConfirm"]</small>
</div>
<!-- 2FA -->
<!-- 2FA. -->
<input type="hidden" id="hidden-use-two-fa" name="use2fa" value="true">
<div class="form-row">
<div class="form-field">
@@ -85,7 +85,7 @@
</div>
</div>
</form>
<!-- section registration success -->
<!-- Section registration success. -->
<div class="text-center w-100">
<p id="register-success" class="text-light-one w-100 hidden">@_localizer["AccountCreated"]</p>
<img id="totp-image" class="w-200px h-200px h-align-m mx-auto mt-10 hidden" />
@@ -100,9 +100,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const form = document.getElementById('register-account-form');
const txtUsername = form.querySelector('[name="Username"]');
const txtPassword = form.querySelector('[name="Password"]');
@@ -115,7 +116,7 @@
const spnTwoFaAttention = document.getElementById('register-two-fa-attention');
const useTwoFaInput = document.getElementById('hidden-use-two-fa');
// perform the account registration
// Perform the account registration.
async function handleRegisterAccountAsync() {
const formData = {
Username: txtUsername.value,
@@ -144,7 +145,7 @@
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -152,13 +153,13 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleRegisterAccountAsync();
};
// on use 2FA change event
// On use 2FA change event.
const handleChkUse2FAChange = function() {
const isChecked = this.checked;
spnTwoFaAttention.classList.replace(
@@ -168,18 +169,18 @@
useTwoFaInput.value = isChecked.toString();
};
// on login button click
// On login button click.
const handleBtnLoginClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.Authentication.LOGIN_VIEW)';
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
chkUse2FA.addEventListener('click', handleChkUse2FAChange);
btnLogin.addEventListener('click', handleBtnLoginClick);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
@@ -187,7 +188,7 @@
btnLogin.removeEventListener('click', handleBtnLoginClick);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -7,7 +7,7 @@
@using Microsoft.AspNetCore.Mvc.Localization
@{
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@@ -16,8 +16,8 @@
<div class="cotton-candy">
<div style="display: grid; grid-template-rows: auto 1fr;">
<!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div id="libraries-container" class="cards-container justify-start pl-10 pr-10 w-100 h-100">
<p id="no-libraries" class="hidden">@_localizer["NoLibraries"]</p>
</div>
@@ -26,10 +26,11 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
let isInitialized = false;
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const librariesContainer = document.getElementById('libraries-container');
const noLibrariesMessage = document.getElementById('no-libraries');
@@ -37,15 +38,15 @@
if (isInitialized)
return;
isInitialized = true;
// get the media libraries
// TODO: add setting check whether the user desires this feature or not
// Get the media libraries.
// TODO: add setting check whether the user desires this feature or not.
const data = await callApiGetAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_ENABLED_LIBRARIES)');
if (data && data.length > 0) {
noLibrariesMessage.classList.replace('block', 'hidden');
librariesContainer.classList.replace('justify-center', 'justify-start');
// populate media library items
// Populate media library items.
data.forEach((library) => {
// book libraries are browsable, so their panel is rendered as a link to their browse page
// Book libraries are browsable, so their panel is rendered as a link to their browse page.
const isBrowsable = library.libraryType === 'Book';
const browseUrl = isBrowsable
? '@_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX)' + '?libraryId=' + library.id
@@ -56,7 +57,7 @@
if (browseUrl)
libraryElement.href = browseUrl;
// the cover image is optional, so it is only rendered when the library has one
// The cover image is optional, so it is only rendered when the library has one.
const coverImageHtml = library.coverImage
? `<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />`
: '';
@@ -68,7 +69,7 @@
librariesContainer.appendChild(libraryElement);
});
// bind the AJAX navigation behavior to the library links, which were created after the initial navigation binding
// Bind the AJAX navigation behavior to the library links, which were created after the initial navigation binding.
bindNavigationLinks();
} else {
noLibrariesMessage.classList.replace('hidden', 'block');
@@ -76,15 +77,15 @@
}
}
// add listeners
// Add listeners.
document.addEventListener('DOMContentLoaded', InitializeAsync);
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
document.removeEventListener('DOMContentLoaded', InitializeAsync);
});
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -18,7 +18,7 @@
@Html.AntiForgeryToken()
<style>
/* main container */
/* Main container. */
.td-scan {
display: flex;
align-items: center;
@@ -27,14 +27,14 @@
min-height: 50px;
}
/* text label */
/* Text label. */
.scan-job-status {
flex: 1;
padding: 0 10px;
min-width: 0;
}
/* progress bar container */
/* Progress bar container. */
.scan-progress {
flex: 0 0 80px;
height: 20px;
@@ -44,7 +44,7 @@
gap: 2px;
}
/* progress bars */
/* Progress bars. */
.scan-progress-total,
.scan-progress-job {
height: 50%;
@@ -75,28 +75,28 @@
}
.icon-groups {
flex: 0 0 auto; /* prevent shrinking */
flex: 0 0 auto; /* Prevent shrinking. */
display: flex;
gap: 10px;
margin-left: auto; /* push to right */
margin-left: auto; /* Push to right. */
}
/* status icons subgroup */
/* Status icons subgroup. */
.status-icons {
display: flex;
gap: 5px;
flex-shrink: 0;
}
/* action icons subgroup */
/* Action icons subgroup. */
.action-icons {
display: flex;
gap: 5px;
flex-shrink: 0;
}
/* icon groups */
/* status icons (right margin group) */
/* Icon groups. */
/* Status icons (right margin group). */
img[src*="green.png"],
img[src*="red.png"],
img[src*="yellow.png"] {
@@ -104,7 +104,7 @@
height: 20px;
}
/* action icons (fixed size group) */
/* Action icons (fixed size group). */
img[src*="stop.svg"],
img[src*="trigger.svg"],
img[src*="delete.svg"],
@@ -129,8 +129,8 @@
}
</style>
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div style="display: grid; grid-template-rows: auto 1fr;"><!-- Container with two rows, one fixed, one filling remaining space. -->
<div style="min-height: 1rem;"></div><!-- The first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position. -->
<div class="enlightenment-panel shadow-effect mx-auto panel w-75 mb-10" style="min-width: 320px;">
<div class="shine-effect"></div>
<div class="form-row">
@@ -149,7 +149,7 @@
</tr>
</thead>
<tbody>
<!-- libraries will be populated here -->
<!-- Libraries will be populated here. -->
</tbody>
</table>
<div class="form-row pt-10">
@@ -214,6 +214,7 @@
PhotoAlbum: '@_localizer["PhotoAlbum"]',
Other: '@_localizer["Other"]'
};
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const btnScanAllLibraries = document.getElementById('btn-scan-all-libraries');
const btnCancelLibrariesScan = document.getElementById('btn-cancel-libraries-scan');
@@ -280,7 +281,7 @@
</tr>
`;
}).join('');
bindNavigationLinks(); // bind the dynamically created edit links, so that editing keeps the persistent chrome running
bindNavigationLinks(); // Bind the dynamically created edit links, so that editing keeps the persistent chrome running.
} else {
btnScanAllLibraries.style.display = 'none';
table.style.display = 'none';
@@ -333,7 +334,7 @@
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${libraryId}`));
if (success) {
await loadLibrariesAsync(); // reload the entire library list
await loadLibrariesAsync(); // Reload the entire library list.
notificationService.show('@_localizer["LibraryDeleted"]', NotificationType.SUCCESS);
}
}
@@ -271,9 +271,10 @@
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls (callApiGetAsync, callApiPostAsync, ...). site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// create cleanup registry for this view
// Create cleanup registry for this view.
const cleanupFunctions = [];
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const saveSuccess = document.getElementById('save-success');
const btnBackToLibraries = document.getElementById('btn-back-to-libraries');
const btnAddNewLibrary = document.getElementById('btn-add-new-library');
@@ -288,7 +289,7 @@
const chkShouldSaveMetadataInMediaDirectories = form.querySelector('[name="ShouldSaveMetadataInMediaDirectories"]');
const chkShouldSkipUnchangedDirectoriesDuringScan = form.querySelector('[name="ShouldSkipUnchangedDirectoriesDuringScan"]');
// create new or update existing media library
// Create new or update existing media library.
async function handleAddMediaLibraryAsync() {
const formData = {
Id: form.querySelector('[name="Id"]').value || null,
@@ -298,9 +299,9 @@
ContentLocations: Array.from(mediaDirectoriesFormTable.querySelectorAll('.form-table-row span'))
.map(span => span.textContent),
CoverImage: (() => {
// get the first (and only) span in the mediaCoverFormTable, if it exists
// Get the first (and only) span in the mediaCoverFormTable, if it exists.
const coverSpan = mediaCoverFormTable.querySelector('.form-table-row span');
return coverSpan ? coverSpan.textContent : null; // return null if no cover image is selected
return coverSpan ? coverSpan.textContent : null; // Return null if no cover image is selected.
})(),
IsEnabled: chkIsEnabled.checked,
IsLocked: chkIsLocked.checked,
@@ -318,13 +319,13 @@
}
function addMediaLibraryDirectories(selectedPaths) {
// process the selected paths (remove quotes and split by comma)
// Process the selected paths (remove quotes and split by comma).
const paths = selectedPaths.slice(1, -1).split('","');
// add each path as a new row
// Add each path as a new row.
paths.forEach(path => {
// normalize the path for comparison
// Normalize the path for comparison.
const normalizedPath = path.replace(/\\\\/g, '\\');
// use querySelectorAll and compare explicitly, so that duplicates are not permitted
// Use querySelectorAll and compare explicitly, so that duplicates are not permitted.
const existingPaths = Array.from(mediaDirectoriesFormTable.querySelectorAll('span[title]'));
const isDuplicate = existingPaths.some(span => span.getAttribute('title') === normalizedPath);
if (!isDuplicate) {
@@ -339,13 +340,13 @@
}
function addMediaLibraryCoverImage(selectedPaths) {
// process the selected paths
// Process the selected paths.
const paths = selectedPaths.slice(1, -1).split('","');
// ensure only one row is allowed by first clearing all previous rows
// Ensure only one row is allowed by first clearing all previous rows.
mediaCoverFormTable.innerHTML = '';
// add the first valid path (if any) as a new row
// Add the first valid path (if any) as a new row.
if (paths.length > 0) {
const path = paths[0]; // only use the first path
const path = paths[0]; // Only use the first path.
mediaCoverFormTable.insertAdjacentHTML('beforeend', `
<div class="form-table-row">
<span title="${path}">${path}</span>
@@ -355,7 +356,7 @@
}
}
// on Enter key pressed
// On Enter key pressed.
const handleEnterKey = async function(e) {
if (e.key === 'Enter') {
e.preventDefault();
@@ -363,33 +364,33 @@
}
};
// on form submit event
// On form submit event.
const handleSubmit = async function(e) {
e.preventDefault();
await handleAddMediaLibraryAsync();
};
// on back to libraries button click
// On back to libraries button click.
const handleBtnBackToLibrariesClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.INDEX)';
};
// on add new library button click
// On add new library button click.
const handleBtnAddNewLibraryClick = function() {
window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.EDIT_LIBRARY)';
};
// on add media directory image click
// On add media directory image click.
const handleImgAddMediaDirectoryClick = async function() {
await showFileSystemBrowserDialogAsync('C:\\Users\\', true, false, addMediaLibraryDirectories); // TODO: take path and include hidden elements from settings
await showFileSystemBrowserDialogAsync('C:\\Users\\', true, false, addMediaLibraryDirectories); // TODO: take path and include hidden elements from settings.
};
// on add cover image click
// On add cover image click.
const handleImgAddCoverClick = async function() {
await showFileSystemBrowserDialogAsync('C:\\Users\\', true, true, addMediaLibraryCoverImage); // TODO: take path and include hidden elements from settings
await showFileSystemBrowserDialogAsync('C:\\Users\\', true, true, addMediaLibraryCoverImage); // TODO: take path and include hidden elements from settings.
};
// on remove row icon click
// On remove row icon click.
const handleRowRemoval = (e) => {
if (e.target.matches('.remove-form-table-row-icon'))
e.target.parentElement.remove();
@@ -399,18 +400,18 @@
const metadataProvidersTable = document.getElementById('metadata-providers-table');
const metadataProvidersTbody = metadataProvidersTable ? metadataProvidersTable.querySelector('tbody') : null;
// loads the metadata providers configured for the library, when editing an existing library
// Loads the metadata providers configured for the library, when editing an existing library.
async function loadMetadataProvidersAsync() {
if (!id || !metadataProvidersTbody) return;
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_METADATA_PROVIDERS, new { libraryId = default(Guid) })'
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
const response = await callApiGetAsync(url);
if (response && response.length > 0) {
metadataProvidersTbody.innerHTML = response.map((provider, index) => renderMetadataProviderRow(provider, index, response.length)).join('');
}
}
// renders a metadata provider row of the library
// Renders a metadata provider row of the library.
function renderMetadataProviderRow(provider, index, count) {
return `
<tr data-provider-plugin-id="${provider.pluginId}">
@@ -428,7 +429,7 @@
</tr>`;
}
// on metadata provider move button click, reorders the providers and persists the new order
// On metadata provider move button click, reorders the providers and persists the new order.
async function handleMetadataProviderReorderAsync(e) {
const button = e.target.closest('.metadata-provider-move-up, .metadata-provider-move-down');
if (!button || !metadataProvidersTbody) return;
@@ -443,7 +444,7 @@
await saveMetadataProviderOrderAsync();
}
// persists the current order of the metadata providers of the library
// Persists the current order of the metadata providers of the library.
async function saveMetadataProviderOrderAsync() {
if (!id || !metadataProvidersTbody) return;
const pluginIds = Array.from(metadataProvidersTbody.querySelectorAll('tr[data-provider-plugin-id]'))
@@ -454,7 +455,7 @@
}
}
// on metadata provider enabled checkbox change, persists the new state
// On metadata provider enabled checkbox change, persists the new state.
async function handleMetadataProviderEnabledChangeAsync(e) {
if (e.target.matches('.metadata-provider-enabled')) {
const row = e.target.closest('tr');
@@ -470,18 +471,18 @@
const artworkProvidersTable = document.getElementById('artwork-providers-table');
const artworkProvidersTbody = artworkProvidersTable ? artworkProvidersTable.querySelector('tbody') : null;
// loads the artwork providers configured for the library, when editing an existing library
// Loads the artwork providers configured for the library, when editing an existing library.
async function loadArtworkProvidersAsync() {
if (!id || !artworkProvidersTbody) return;
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_ARTWORK_PROVIDERS, new { libraryId = default(Guid) })'
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
const response = await callApiGetAsync(url);
if (response && response.length > 0) {
artworkProvidersTbody.innerHTML = response.map((provider, index) => renderArtworkProviderRow(provider, index, response.length)).join('');
}
}
// renders an artwork provider row of the library
// Renders an artwork provider row of the library.
function renderArtworkProviderRow(provider, index, count) {
return `
<tr data-provider-plugin-id="${provider.pluginId}">
@@ -499,7 +500,7 @@
</tr>`;
}
// on artwork provider move button click, reorders the providers and persists the new order
// On artwork provider move button click, reorders the providers and persists the new order.
async function handleArtworkProviderReorderAsync(e) {
const button = e.target.closest('.artwork-provider-move-up, .artwork-provider-move-down');
if (!button || !artworkProvidersTbody) return;
@@ -514,7 +515,7 @@
await saveArtworkProviderOrderAsync();
}
// persists the current order of the artwork providers of the library
// Persists the current order of the artwork providers of the library.
async function saveArtworkProviderOrderAsync() {
if (!id || !artworkProvidersTbody) return;
const pluginIds = Array.from(artworkProvidersTbody.querySelectorAll('tr[data-provider-plugin-id]'))
@@ -525,7 +526,7 @@
}
}
// on artwork provider enabled checkbox change, persists the new state
// On artwork provider enabled checkbox change, persists the new state.
async function handleArtworkProviderEnabledChangeAsync(e) {
if (e.target.matches('.artwork-provider-enabled')) {
const row = e.target.closest('tr');
@@ -541,18 +542,18 @@
const bookReadersTable = document.getElementById('book-readers-table');
const bookReadersTbody = bookReadersTable ? bookReadersTable.querySelector('tbody') : null;
// loads the book readers configured for the library, when editing an existing library
// Loads the book readers configured for the library, when editing an existing library.
async function loadBookReadersAsync() {
if (!id || !bookReadersTbody) return;
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_BOOK_READERS, new { libraryId = default(Guid) })'
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side
.replace('/@(default(Guid))', `/${id}`); // libraryId needs to be replaced here, because GetAbsoluteUrl is server side, libraryId is client side.
const response = await callApiGetAsync(url);
if (response && response.length > 0) {
bookReadersTbody.innerHTML = response.map(reader => renderBookReaderRow(reader)).join('');
}
}
// renders a book reader row of the library
// Renders a book reader row of the library.
function renderBookReaderRow(reader) {
const extensions = (reader.supportedExtensions || []).join(', ');
return `
@@ -568,7 +569,7 @@
</tr>`;
}
// on book reader enabled checkbox change, persists the new state
// On book reader enabled checkbox change, persists the new state.
async function handleBookReaderEnabledChangeAsync(e) {
if (e.target.matches('.book-reader-enabled')) {
const row = e.target.closest('tr');
@@ -581,7 +582,7 @@
}
};
// add listeners
// Add listeners.
form.addEventListener('keypress', handleEnterKey);
form.addEventListener('submit', handleSubmit);
btnBackToLibraries.addEventListener('click', handleBtnBackToLibrariesClick);
@@ -602,7 +603,7 @@
bookReadersTbody.addEventListener('change', handleBookReaderEnabledChangeAsync);
}
// register cleanup for these listeners
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
form.removeEventListener('keypress', handleEnterKey);
form.removeEventListener('submit', handleSubmit);
@@ -625,14 +626,14 @@
}
});
// load the metadata and artwork providers and book readers when editing an existing library
// Load the metadata and artwork providers and book readers when editing an existing library.
if (id) {
loadMetadataProvidersAsync();
loadArtworkProvidersAsync();
loadBookReadersAsync();
}
// store all cleanups for this view on window object using the scriptId
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
@@ -1,4 +1,15 @@
@*
FALLBACK BOOKS BROWSING VIEW - READ BEFORE EDITING
This view is the application fallback of the books browsing page, rendered only when the theme template
of the page cannot be loaded. On a healthy site the page comes from the theme's
library/written-content-library/book-library/books/index template. It keeps the DOM contract and the
client script the theme template mirrors, so that navigation, searching and the card actions menu keep
working even without the theme.
To restyle the page, edit the theme files. This fallback is intentionally plain, so that a broken theme
is obvious to the user while the page still functions.
/library/written-content-library/books-library/books?libraryId=...
*@
@@ -55,7 +66,9 @@
const libraryId = '@(Model.Id ?? Guid.Empty)';
const readUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.READ, new { bookId = default(Guid) })';
const detailsUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.EDIT_BOOK, new { id = default(Guid) })';
const availabilityUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.GET_READING_AVAILABILITY, new { bookId = default(Guid) })';
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const booksContainer = document.getElementById('books-container');
const noItemsMessage = document.getElementById('no-items');
const noItemsMatchingMessage = document.getElementById('no-items-matching');
@@ -89,7 +102,9 @@
sortAscending: '@_localizer["SortAscending"]',
sortDescending: '@_localizer["SortDescending"]',
readerUnavailable: '@_localizer["ReaderUnavailable"]',
readerDisabled: '@_localizer["ReaderDisabled"]'
readerDisabled: '@_localizer["ReaderDisabled"]',
read: '@_localizer["Read"]',
viewDetails: '@_localizer["ViewDetails"]'
};
// Builds the URL of the retrieval endpoint, from the current state.
@@ -122,7 +137,7 @@
// Renders the retrieved books, the count label and the pagination controls.
function renderItems(response) {
booksContainer.querySelectorAll('.media-panel').forEach(card => card.remove());
booksContainer.querySelectorAll('.media-card').forEach(card => card.remove());
const hasActiveFilters = state.searchTerm !== '' || state.alphaKey !== null;
if (response.count === 0) {
@@ -144,20 +159,25 @@
}
// Creates a portrait card for a book, with its cover image (or a placeholder) and its title, that opens the reader when clicked.
// The card carries a actions trigger that opens a menu with the actions available for the book, like viewing its details.
function createBookCard(book) {
const card = document.createElement('a');
card.className = 'media-panel nav-link no-underline';
card.style.width = '160px';
card.style.height = '240px';
card.href = readUrlTemplate.replace('/@(default(Guid))', `/${book.id}`);
const card = document.createElement('div');
card.className = 'media-card';
card.dataset.bookId = book.id;
const cardLink = document.createElement('a');
cardLink.className = 'media-panel nav-link no-underline';
cardLink.style.width = '160px';
cardLink.style.height = '240px';
cardLink.dataset.bookId = book.id;
cardLink.href = readUrlTemplate.replace('/@(default(Guid))', `/${book.id}`);
// Opening the reader is conditional on the reader being available and enabled for the library, so the generic nav-link
// navigation is intercepted and replaced by one that first checks the reading availability, warning instead of navigating
// when the book cannot be read.
card.addEventListener('click', async event => {
cardLink.addEventListener('click', async event => {
event.preventDefault();
event.stopImmediatePropagation();
await handleBookCardClickAsync(card);
await handleBookCardClickAsync(cardLink);
});
const image = document.createElement('img');
@@ -172,11 +192,113 @@
title.textContent = book.title;
titleSpan.appendChild(title);
card.appendChild(image);
card.appendChild(titleSpan);
cardLink.appendChild(image);
cardLink.appendChild(titleSpan);
const detailsUrl = detailsUrlTemplate.replace('/@(default(Guid))', `/${book.id}`);
const trigger = document.createElement('button');
trigger.type = 'button';
trigger.className = 'card-actions-trigger';
trigger.setAttribute('aria-haspopup', 'menu');
trigger.setAttribute('aria-label', jsLocalizedStrings.viewDetails);
trigger.addEventListener('click', event => {
event.preventDefault();
event.stopImmediatePropagation();
toggleCardMenu(card, resolveMenuAnchor(event));
});
const menu = document.createElement('nav');
menu.className = 'card-actions-menu';
menu.setAttribute('role', 'menu');
menu.innerHTML = `
<a role="menuitem" href="${readUrlTemplate.replace('/@(default(Guid))', `/${book.id}`)}">${jsLocalizedStrings.read}</a>
<a role="menuitem" href="${detailsUrl}">${jsLocalizedStrings.viewDetails}</a>`;
// Menu entries navigate through the same AJAX navigation used by the nav-links, so that the persistent chrome keeps running.
menu.addEventListener('click', async event => {
const menuItem = event.target.closest('a[role="menuitem"]');
if (!menuItem)
return;
event.preventDefault();
event.stopImmediatePropagation();
closeCardMenus();
await updateContentAsync(menuItem.href, true);
});
card.appendChild(cardLink);
card.appendChild(trigger);
card.appendChild(menu);
// A right click on the card opens the same actions menu.
card.addEventListener('contextmenu', event => {
event.preventDefault();
event.stopImmediatePropagation();
toggleCardMenu(card, resolveMenuAnchor(event));
});
card.addEventListener('click', event => {
// Clicking anywhere on the card outside the trigger and the menu closes the menu, when it is open.
if (card.classList.contains('open') && !event.target.closest('.card-actions-menu'))
closeCardMenus();
});
return card;
}
// Toggles the actions menu of the book card, opening it with its top left corner at the given viewport position.
function toggleCardMenu(card, anchor) {
const wasOpen = card.classList.contains('open');
closeCardMenus();
if (wasOpen)
return;
card.classList.add('open');
const menu = card.querySelector('.card-actions-menu');
if (menu) {
menu.classList.add('open');
positionActionsMenu(menu, anchor);
}
}
// Resolves the viewport point where the card actions menu opens: the pointer tip for mouse gestures, and the lower
// left corner of the actions trigger for keyboard activation, whose synthetic click carries no pointer position.
function resolveMenuAnchor(event) {
if (event.clientX !== 0 || event.clientY !== 0)
return { x: event.clientX, y: event.clientY };
const triggerRect = event.currentTarget.getBoundingClientRect();
return { x: triggerRect.left, y: triggerRect.bottom };
}
// Places the card actions menu with its top left corner at the requested viewport point, moving it left or up only
// when it would otherwise run past the viewport edges, like a desktop context menu does.
function positionActionsMenu(menu, anchor) {
const margin = 4;
const maxLeft = Math.max(margin, window.innerWidth - menu.offsetWidth - margin);
const maxTop = Math.max(margin, window.innerHeight - menu.offsetHeight - margin);
menu.style.position = 'fixed';
menu.style.left = `${Math.min(Math.max(margin, anchor.x), maxLeft)}px`;
menu.style.top = `${Math.min(Math.max(margin, anchor.y), maxTop)}px`;
}
// Closes the actions menus of all the book cards.
function closeCardMenus() {
booksContainer.querySelectorAll('.media-card.open').forEach(card => {
card.classList.remove('open');
const menu = card.querySelector('.card-actions-menu');
if (menu)
menu.classList.remove('open');
});
}
// Closes the actions menus when clicking or pressing a key outside them.
function handleCardMenuDismiss(event) {
if (event.type === 'keydown' && event.key !== 'Escape')
return;
if (event.type === 'click' && event.target.closest('.card-actions-menu, .card-actions-trigger'))
return;
closeCardMenus();
}
// Opens the reader of the book when it can be read, and warns the user otherwise; the navigation is done through the same
// AJAX navigation used by the nav-links, so that the page is not reloaded (and the audio player is not interrupted).
async function handleBookCardClickAsync(card) {
@@ -198,6 +320,8 @@
// Updates the count label: total items when pagination is off, displayed range out of total when it is on.
function updateCountLabel(response) {
if (!countLabel)
return;
if (state.perPage === null)
countLabel.textContent = `${response.count} ${jsLocalizedStrings.items}`;
else if (response.count === 0)
@@ -211,6 +335,8 @@
// Updates the pagination controls, which are only visible when pagination is enabled.
function updatePagination(response) {
if (!pagination)
return;
if (state.perPage === null) {
pagination.classList.add('hidden');
return;
@@ -224,6 +350,8 @@
// Builds the alpha picker column, with the "All" key followed by the numbers, symbols and letters keys.
function buildAlphaPicker() {
if (!alphaPicker)
return;
const allKey = document.createElement('span');
allKey.className = 'alpha-key';
allKey.dataset.alphaKey = '';
@@ -245,6 +373,8 @@
// Highlights the currently active key of the alpha picker.
function updateAlphaPickerActiveState() {
if (!alphaPicker)
return;
alphaPicker.querySelectorAll('.alpha-key').forEach(key => {
const keyValue = key.dataset.alphaKey === '' ? null : key.dataset.alphaKey;
key.classList.toggle('alpha-key-active', keyValue === state.alphaKey);
@@ -313,29 +443,51 @@
loadItemsAsync();
}
// Binds an event handler to an element, when the element is present.
function bindEventHandler(element, type, handler) {
if (element)
element.addEventListener(type, handler);
}
// Unbinds an event handler from an element, when the element is present.
function unbindEventHandler(element, type, handler) {
if (element)
element.removeEventListener(type, handler);
}
// Add listeners.
searchButton.addEventListener('click', handleSearch);
searchInput.addEventListener('keydown', handleSearchKeydown);
sortToggle.addEventListener('click', handleSortToggle);
prevPageButton.addEventListener('click', handlePrevPageClick);
nextPageButton.addEventListener('click', handleNextPageClick);
bindEventHandler(searchButton, 'click', handleSearch);
bindEventHandler(searchInput, 'keydown', handleSearchKeydown);
bindEventHandler(sortToggle, 'click', handleSortToggle);
bindEventHandler(prevPageButton, 'click', handlePrevPageClick);
bindEventHandler(nextPageButton, 'click', handleNextPageClick);
document.addEventListener('keydown', handleAlphaKeydown);
document.addEventListener('click', handleCardMenuDismiss);
document.addEventListener('keydown', handleCardMenuDismiss);
document.addEventListener('DOMContentLoaded', InitializeAsync);
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
searchButton.removeEventListener('click', handleSearch);
searchInput.removeEventListener('keydown', handleSearchKeydown);
sortToggle.removeEventListener('click', handleSortToggle);
prevPageButton.removeEventListener('click', handlePrevPageClick);
nextPageButton.removeEventListener('click', handleNextPageClick);
unbindEventHandler(searchButton, 'click', handleSearch);
unbindEventHandler(searchInput, 'keydown', handleSearchKeydown);
unbindEventHandler(sortToggle, 'click', handleSortToggle);
unbindEventHandler(prevPageButton, 'click', handlePrevPageClick);
unbindEventHandler(nextPageButton, 'click', handleNextPageClick);
document.removeEventListener('keydown', handleAlphaKeydown);
document.removeEventListener('click', handleCardMenuDismiss);
document.removeEventListener('keydown', handleCardMenuDismiss);
document.removeEventListener('DOMContentLoaded', InitializeAsync);
});
async function InitializeAsync() {
if (isInitialized)
return;
// When the page is restored from the history cache before its fresh content arrives, its container may be missing;
// a fresh copy of this script initializes the page once the fresh content is in place, so this instance gives up.
if (!booksContainer || !sortToggle || !countLabel) {
isInitialized = true;
return;
}
isInitialized = true;
sortToggle.textContent = jsLocalizedStrings.sortAscending;
buildAlphaPicker();
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff. Show more