Adds a theme caching toggle to the user settings

This commit is contained in:
BinaryAlley committed 2026-08-21 04:04:54 -07:00
1 parent 60b551558f
commit 3da7167538
43 files changed
+1611 -56

No files matched your search

@@ -37,6 +37,11 @@ public class UserSettingsEntity : IStorageEntity, IAuditableEntity
/// </summary>
public bool IgnoreThePrefixForAlphaPicker { get; set; }
/// <summary>
/// Gets or sets whether the theme data served to this user is cached, or not.
/// </summary>
public bool IsThemeCachingEnabled { get; set; } = true;
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
@@ -20,6 +20,7 @@ public static class UpdateUserSettingsRequestMapping
return new UpdateUserSettingsCommand(
request.IsPaginationEnabled,
request.ItemsPerPage,
request.IgnoreThePrefixForAlphaPicker);
request.IgnoreThePrefixForAlphaPicker,
request.IsThemeCachingEnabled);
}
}
@@ -28,7 +28,8 @@ public static class UserSettingsEntityMapping
UserId.Create(repositoryEntity.UserId),
repositoryEntity.IsPaginationEnabled,
repositoryEntity.ItemsPerPage,
repositoryEntity.IgnoreThePrefixForAlphaPicker);
repositoryEntity.IgnoreThePrefixForAlphaPicker,
repositoryEntity.IsThemeCachingEnabled);
}
/// <summary>
@@ -42,6 +43,7 @@ public static class UserSettingsEntityMapping
repositoryEntity.UserId,
repositoryEntity.IsPaginationEnabled,
repositoryEntity.ItemsPerPage,
repositoryEntity.IgnoreThePrefixForAlphaPicker);
repositoryEntity.IgnoreThePrefixForAlphaPicker,
repositoryEntity.IsThemeCachingEnabled);
}
}
@@ -24,7 +24,8 @@ public static class UserSettingsMapping
UserId = domainEntity.UserId.Value,
IsPaginationEnabled = domainEntity.IsPaginationEnabled,
ItemsPerPage = domainEntity.ItemsPerPage,
IgnoreThePrefixForAlphaPicker = domainEntity.IgnoreThePrefixForAlphaPicker
IgnoreThePrefixForAlphaPicker = domainEntity.IgnoreThePrefixForAlphaPicker,
IsThemeCachingEnabled = domainEntity.IsThemeCachingEnabled
};
}
@@ -39,6 +40,7 @@ public static class UserSettingsMapping
domainEntity.UserId.Value,
domainEntity.IsPaginationEnabled,
domainEntity.ItemsPerPage,
domainEntity.IgnoreThePrefixForAlphaPicker);
domainEntity.IgnoreThePrefixForAlphaPicker,
domainEntity.IsThemeCachingEnabled);
}
}
@@ -10,8 +10,10 @@ namespace Lumina.Application.Core.UsersManagement.Settings.Commands.UpdateUserSe
/// <param name="IsPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="ItemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="IgnoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="IsThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
public record UpdateUserSettingsCommand(
bool IsPaginationEnabled,
int ItemsPerPage,
bool IgnoreThePrefixForAlphaPicker
bool IgnoreThePrefixForAlphaPicker,
bool IsThemeCachingEnabled
) : ICommand;
@@ -72,7 +72,8 @@ public class UpdateUserSettingsCommandHandler : ICommandHandler<UpdateUserSettin
UserId.Create(userId),
command.IsPaginationEnabled,
command.ItemsPerPage,
command.IgnoreThePrefixForAlphaPicker);
command.IgnoreThePrefixForAlphaPicker,
command.IsThemeCachingEnabled);
if (createSettingsResult.IsFailure)
return createSettingsResult.Errors;
@@ -90,7 +91,8 @@ public class UpdateUserSettingsCommandHandler : ICommandHandler<UpdateUserSettin
Result<Updated> updateSettingsResult = toDomainEntityResult.Value.UpdateSettings(
command.IsPaginationEnabled,
command.ItemsPerPage,
command.IgnoreThePrefixForAlphaPicker);
command.IgnoreThePrefixForAlphaPicker,
command.IsThemeCachingEnabled);
if (updateSettingsResult.IsFailure)
return updateSettingsResult.Errors;
@@ -10,9 +10,11 @@ namespace Lumina.Contracts.Requests.UsersManagement.Settings;
/// <param name="IsPaginationEnabled">Whether pagination is enabled for the user, or not. Required.</param>
/// <param name="ItemsPerPage">The number of library items displayed per page when pagination is enabled. Required.</param>
/// <param name="IgnoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not. Required.</param>
/// <param name="IsThemeCachingEnabled">Whether the theme data served to this user is cached, or not. Required.</param>
[DebuggerDisplay("IsPaginationEnabled: {IsPaginationEnabled}; ItemsPerPage: {ItemsPerPage}")]
public sealed record UpdateUserSettingsRequest(
bool IsPaginationEnabled,
int ItemsPerPage,
bool IgnoreThePrefixForAlphaPicker
bool IgnoreThePrefixForAlphaPicker,
bool IsThemeCachingEnabled
);
@@ -12,10 +12,12 @@ namespace Lumina.Contracts.Responses.UsersManagement.Settings;
/// <param name="IsPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="ItemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="IgnoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="IsThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
[DebuggerDisplay("UserId: {UserId}")]
public sealed record UserSettingsResponse(
Guid UserId,
bool IsPaginationEnabled,
int ItemsPerPage,
bool IgnoreThePrefixForAlphaPicker
bool IgnoreThePrefixForAlphaPicker,
bool IsThemeCachingEnabled
);
@@ -47,6 +47,10 @@ public class UserSettingsConfiguration : IEntityTypeConfiguration<UserSettingsEn
.IsRequired()
.HasColumnOrder(4);
builder.Property(settings => settings.IsThemeCachingEnabled)
.IsRequired()
.HasColumnOrder(9);
// audit
builder.Property(settings => settings.CreatedOnUtc)
.IsRequired()
@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lumina.DataAccess.Common.Migrations
{
/// <inheritdoc />
public partial class AddsIsThemeCachingEnabledToUserSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsThemeCachingEnabled",
table: "UserSettings",
type: "INTEGER",
nullable: false,
defaultValue: true)
.Annotation("Relational:ColumnOrder", 9);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsThemeCachingEnabled",
table: "UserSettings");
}
}
}
@@ -972,6 +972,10 @@ namespace Lumina.DataAccess.Common.Migrations
.HasColumnType("INTEGER")
.HasColumnOrder(2);
b.Property<bool>("IsThemeCachingEnabled")
.HasColumnType("INTEGER")
.HasColumnOrder(9);
b.Property<int>("ItemsPerPage")
.HasColumnType("INTEGER")
.HasColumnOrder(3);
@@ -19,6 +19,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
private const bool DEFAULT_IS_PAGINATION_ENABLED = true;
private const int DEFAULT_ITEMS_PER_PAGE = 48;
private const bool DEFAULT_IGNORE_THE_PREFIX_FOR_ALPHA_PICKER = false;
private const bool DEFAULT_IS_THEME_CACHING_ENABLED = true;
/// <summary>
/// Gets the object representing the unique identifier of the user that owns these settings.
@@ -40,6 +41,11 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// </summary>
public bool IgnoreThePrefixForAlphaPicker { get; private set; }
/// <summary>
/// Gets whether the theme data served to this user is cached, or not.
/// </summary>
public bool IsThemeCachingEnabled { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="UserSettings"/> class.
/// </summary>
@@ -48,17 +54,20 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// <param name="isPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="itemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="ignoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
private UserSettings(
UserSettingsId id,
UserId userId,
bool isPaginationEnabled,
int itemsPerPage,
bool ignoreThePrefixForAlphaPicker) : base(id)
bool ignoreThePrefixForAlphaPicker,
bool isThemeCachingEnabled) : base(id)
{
UserId = userId;
IsPaginationEnabled = isPaginationEnabled;
ItemsPerPage = itemsPerPage;
IgnoreThePrefixForAlphaPicker = ignoreThePrefixForAlphaPicker;
IsThemeCachingEnabled = isThemeCachingEnabled;
}
/// <summary>
@@ -69,7 +78,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// </returns>
public static Result<UserSettings> Create()
{
return Create(UserId.CreateUnique(), DEFAULT_IS_PAGINATION_ENABLED, DEFAULT_ITEMS_PER_PAGE, DEFAULT_IGNORE_THE_PREFIX_FOR_ALPHA_PICKER);
return Create(UserId.CreateUnique(), DEFAULT_IS_PAGINATION_ENABLED, DEFAULT_ITEMS_PER_PAGE, DEFAULT_IGNORE_THE_PREFIX_FOR_ALPHA_PICKER, DEFAULT_IS_THEME_CACHING_ENABLED);
}
/// <summary>
@@ -81,7 +90,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// </returns>
public static Result<UserSettings> Create(UserId userId)
{
return Create(userId, DEFAULT_IS_PAGINATION_ENABLED, DEFAULT_ITEMS_PER_PAGE, DEFAULT_IGNORE_THE_PREFIX_FOR_ALPHA_PICKER);
return Create(userId, DEFAULT_IS_PAGINATION_ENABLED, DEFAULT_ITEMS_PER_PAGE, DEFAULT_IGNORE_THE_PREFIX_FOR_ALPHA_PICKER, DEFAULT_IS_THEME_CACHING_ENABLED);
}
/// <summary>
@@ -91,6 +100,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// <param name="isPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="itemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="ignoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either a successfully created <see cref="UserSettings"/>, or an error message.
/// </returns>
@@ -98,7 +108,8 @@ public class UserSettings : AggregateRoot<UserSettingsId>
UserId userId,
bool isPaginationEnabled,
int itemsPerPage,
bool ignoreThePrefixForAlphaPicker)
bool ignoreThePrefixForAlphaPicker,
bool isThemeCachingEnabled)
{
if (itemsPerPage <= 0)
return Errors.UserSettings.ItemsPerPageMustBeGreaterThanZero;
@@ -108,7 +119,8 @@ public class UserSettings : AggregateRoot<UserSettingsId>
userId,
isPaginationEnabled,
itemsPerPage,
ignoreThePrefixForAlphaPicker);
ignoreThePrefixForAlphaPicker,
isThemeCachingEnabled);
}
/// <summary>
@@ -119,6 +131,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// <param name="isPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="itemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="ignoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either a successfully created <see cref="UserSettings"/>, or an error message.
/// </returns>
@@ -127,12 +140,13 @@ public class UserSettings : AggregateRoot<UserSettingsId>
UserId userId,
bool isPaginationEnabled,
int itemsPerPage,
bool ignoreThePrefixForAlphaPicker)
bool ignoreThePrefixForAlphaPicker,
bool isThemeCachingEnabled)
{
if (itemsPerPage <= 0)
return Errors.UserSettings.ItemsPerPageMustBeGreaterThanZero;
return new UserSettings(id, userId, isPaginationEnabled, itemsPerPage, ignoreThePrefixForAlphaPicker);
return new UserSettings(id, userId, isPaginationEnabled, itemsPerPage, ignoreThePrefixForAlphaPicker, isThemeCachingEnabled);
}
/// <summary>
@@ -141,11 +155,13 @@ public class UserSettings : AggregateRoot<UserSettingsId>
/// <param name="isPaginationEnabled">Whether pagination is enabled for the user, or not.</param>
/// <param name="itemsPerPage">The number of library items displayed per page when pagination is enabled.</param>
/// <param name="ignoreThePrefixForAlphaPicker">Whether the "The" prefix of library item titles is ignored by the alpha picker, or not.</param>
/// <param name="isThemeCachingEnabled">Whether the theme data served to this user is cached, or not.</param>
/// <returns>An <see cref="Result{TValue}"/> representing either a successful update, or an error.</returns>
public Result<Updated> UpdateSettings(
bool isPaginationEnabled,
int itemsPerPage,
bool ignoreThePrefixForAlphaPicker)
bool ignoreThePrefixForAlphaPicker,
bool isThemeCachingEnabled)
{
if (itemsPerPage <= 0)
return Errors.UserSettings.ItemsPerPageMustBeGreaterThanZero;
@@ -153,6 +169,7 @@ public class UserSettings : AggregateRoot<UserSettingsId>
IsPaginationEnabled = isPaginationEnabled;
ItemsPerPage = itemsPerPage;
IgnoreThePrefixForAlphaPicker = ignoreThePrefixForAlphaPicker;
IsThemeCachingEnabled = isThemeCachingEnabled;
return Result.Updated;
}
}
@@ -26,7 +26,8 @@ public class GetUserSettingsEndpointSummary : Summary<GetUserSettingsEndpoint, E
UserId: Guid.NewGuid(),
IsPaginationEnabled: true,
ItemsPerPage: 48,
IgnoreThePrefixForAlphaPicker: false
IgnoreThePrefixForAlphaPicker: false,
IsThemeCachingEnabled: true
));
Response(401, "Authentication required.", "application/problem+json",
@@ -24,9 +24,15 @@ public class UpdateUserSettingsEndpointSummary : Summary<UpdateUserSettingsEndpo
ExampleRequest = new UpdateUserSettingsRequest(
IsPaginationEnabled: true,
ItemsPerPage: 48,
IgnoreThePrefixForAlphaPicker: false
IgnoreThePrefixForAlphaPicker: false,
IsThemeCachingEnabled: true
);
RequestParam(r => r.IsPaginationEnabled, "Whether pagination is enabled for the user, or not. Required.");
RequestParam(r => r.ItemsPerPage, "The number of library items displayed per page when pagination is enabled. Required.");
RequestParam(r => r.IgnoreThePrefixForAlphaPicker, "Whether the \"The\" prefix of library item titles is ignored by the alpha picker, or not. Required.");
RequestParam(r => r.IsThemeCachingEnabled, "Whether the theme data served to this user is cached, or not. Required.");
Response(200, "The settings of the current user were successfully updated.");
Response(401, "Authentication required.", "application/problem+json",
@@ -30,4 +30,9 @@ public class UserSettingsDto
/// Gets or sets whether the "The" prefix of library item titles is ignored by the alpha picker, or not.
/// </summary>
public bool IgnoreThePrefixForAlphaPicker { get; set; }
/// <summary>
/// Gets or sets whether the theme data served to this user is cached, or not.
/// </summary>
public bool IsThemeCachingEnabled { get; set; } = true;
}
@@ -3,9 +3,12 @@ using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.UsersManagement;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -18,14 +21,17 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Tools.Settings.GetUserSettings;
public class GetUserSettingsEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
private readonly ThemeCachePreferenceService _themeCachePreferenceService;
/// <summary>
/// Initializes a new instance of the <see cref="GetUserSettingsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetUserSettingsEndpoint(IApiHttpClient apiHttpClient)
/// <param name="themeCachePreferenceService">Injected service for storing the per-user theme cache preference.</param>
public GetUserSettingsEndpoint(IApiHttpClient apiHttpClient, ThemeCachePreferenceService themeCachePreferenceService)
{
_apiHttpClient = apiHttpClient;
_themeCachePreferenceService = themeCachePreferenceService;
}
/// <summary>
@@ -48,6 +54,22 @@ public class GetUserSettingsEndpoint : BaseEndpoint<EmptyRequest, IResult>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
UserSettingsDto response = await _apiHttpClient.GetAsync<UserSettingsDto>(ApiRoutes.Users.GET_USER_SETTINGS, cancellationToken).ConfigureAwait(false);
// refresh the per-user theme cache preference from the stored settings, so the handler always applies the latest value
Guid? userId = GetCurrentUserId();
if (userId is not null)
await _themeCachePreferenceService.SetAsync(userId.Value, response.IsThemeCachingEnabled, cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Gets the unique identifier of the currently authenticated user.
/// </summary>
/// <returns>The unique identifier of the current user, or <see langword="null"/> when the request is anonymous.</returns>
private Guid? GetCurrentUserId()
{
string? userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
return Guid.TryParse(userId, out Guid parsedUserId) ? parsedUserId : null;
}
}
@@ -3,9 +3,12 @@ using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.UsersManagement;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -18,14 +21,17 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Tools.Settings.UpdateUserSettin
public class UpdateUserSettingsEndpoint : BaseEndpoint<UserSettingsDto, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
private readonly ThemeCachePreferenceService _themeCachePreferenceService;
/// <summary>
/// Initializes a new instance of the <see cref="UpdateUserSettingsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public UpdateUserSettingsEndpoint(IApiHttpClient apiHttpClient)
/// <param name="themeCachePreferenceService">Injected service for storing the per-user theme cache preference.</param>
public UpdateUserSettingsEndpoint(IApiHttpClient apiHttpClient, ThemeCachePreferenceService themeCachePreferenceService)
{
_apiHttpClient = apiHttpClient;
_themeCachePreferenceService = themeCachePreferenceService;
}
/// <summary>
@@ -49,6 +55,22 @@ public class UpdateUserSettingsEndpoint : BaseEndpoint<UserSettingsDto, IResult>
public override async Task<IResult> ExecuteAsync(UserSettingsDto request, CancellationToken cancellationToken)
{
await _apiHttpClient.PutAsync<Web.Common.Requests.Common.EmptyRequest, UserSettingsDto>(ApiRoutes.Users.UPDATE_USER_SETTINGS, request, cancellationToken).ConfigureAwait(false);
// keep the per-user theme cache preference in sync with the stored settings, so the handler applies it immediately
Guid? userId = GetCurrentUserId();
if (userId is not null)
await _themeCachePreferenceService.SetAsync(userId.Value, request.IsThemeCachingEnabled, cancellationToken).ConfigureAwait(false);
return JsonSuccess(new { isUpdated = true });
}
/// <summary>
/// Gets the unique identifier of the currently authenticated user.
/// </summary>
/// <returns>The unique identifier of the current user, or <see langword="null"/> when the request is anonymous.</returns>
private Guid? GetCurrentUserId()
{
string? userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
return Guid.TryParse(userId, out Guid parsedUserId) ? parsedUserId : null;
}
}
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>Wenn aktiviert, werden Bibliothekselemente, deren Titel mit "The" beginnt, in der Alpha-Auswahl unter dem ersten Buchstaben des folgenden Wortes gruppiert, z. B. wird "The Rasmus" unter R aufgeführt.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Themencache aktivieren</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Gibt an, ob die von der Anwendung bereitgestellten Themendateien zwischengespeichert werden. Deaktivieren Sie diese Option beim Bearbeiten von Themendateien, damit die Änderungen sofort erscheinen.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>When enabled, library items whose title begins with "The" are grouped under the first letter of the following word in the alpha picker, e.g. "The Rasmus" is listed under R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Enable theme caching</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Whether the theme files served by the application are cached. Turn this off while editing theme files so the changes appear immediately.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>Cuando está habilitado, los elementos de la biblioteca cuyo título comienza con "The" se agrupan bajo la primera letra de la palabra siguiente en el selector alfabético, por ejemplo, "The Rasmus" se lista bajo R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Habilitar caché de temas</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Controla si los archivos de temas servidos por la aplicación se almacenan en caché. Desactívelo mientras edita archivos de temas para que los cambios aparezcan inmediatamente.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>Lorsque cette option est activée, les éléments de la bibliothèque dont le titre commence par "The" sont regroupés sous la première lettre du mot suivant dans le sélecteur alphabétique, par exemple "The Rasmus" est répertorié sous R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Activer le cache des thèmes</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Contrôle si les fichiers de thèmes servis par l'application sont mis en cache. Désactivez-le pendant la modification des fichiers de thèmes afin que les changements apparaissent immédiatement.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>Se abilitato, gli elementi della libreria il cui titolo inizia con "The" vengono raggruppati sotto la prima lettera della parola successiva nel selettore alfabetico, ad esempio "The Rasmus" è elencato sotto R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Abilita la cache dei temi</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Controlla se i file dei temi serviti dall'applicazione vengono memorizzati nella cache. Disattivalo mentre modifichi i file dei temi affinché le modifiche appaiano immediatamente.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>有効にすると、タイトルが「The」で始まるライブラリの項目は、アルファピッカーで次の単語の最初の文字の下にグループ化されます。たとえば「The Rasmus」は「R」の下に表示されます。</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>テーマキャッシュを有効にする</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>アプリケーションが提供するテーマファイルをキャッシュするかどうかを制御します。テーマファイルを編集している間はオフにして、変更がすぐに反映されるようにします。</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>When enabled, library items whose title begins with "The" are grouped under the first letter of the following word in the alpha picker, e.g. "The Rasmus" is listed under R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Enable theme caching</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Whether the theme files served by the application are cached. Turn this off while editing theme files so the changes appear immediately.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>Când este activată, elementele bibliotecii al căror titlu începe cu "The" sunt grupate sub prima literă a cuvântului următor în selectorul alfabetic, de exemplu "The Rasmus" este listat sub R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Activează cache-ul temelor</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Controlează dacă fișierele temelor servite de aplicație sunt puse în cache. Dezactivați această opțiune în timp ce editați fișierele temelor, pentru ca modificările să apară imediat.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>При включении элементы библиотеки, название которых начинается с "The", группируются в алфавитном указателе под первой буквой следующего слова, например "The Rasmus" отображается под буквой R.</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>Включить кэширование тем</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>Определяет, кэшируются ли файлы тем, предоставляемые приложением. Отключите эту опцию при редактировании файлов тем, чтобы изменения отображались сразу.</value>
</data>
</root>
@@ -39,4 +39,10 @@
<data name="DescriptionIgnoreThePrefixForAlphaPicker" xml:space="preserve">
<value>启用后,标题以"The"开头的库项目将在字母选择器中按后一个词的首字母分组,例如"The Rasmus"会列在R下。</value>
</data>
<data name="EnableThemeCaching" xml:space="preserve">
<value>启用主题缓存</value>
</data>
<data name="DescriptionEnableThemeCaching" xml:space="preserve">
<value>控制应用程序提供的主题文件是否缓存。编辑主题文件时请关闭此选项,以便更改立即生效。</value>
</data>
</root>
@@ -65,6 +65,19 @@
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionIgnoreThePrefixForAlphaPicker"]</small>
</div>
<!-- Theme caching -->
<div class="form-row">
<div class="form-label">
<label asp-for="IsThemeCachingEnabled">@_localizer["EnableThemeCaching"]</label>:
</div>
<div class="form-field">
<label class="enlightenment-checkbox-label">
<input type="checkbox" asp-for="IsThemeCachingEnabled" class="enlightenment-checkbox-hidden" />
<span class="enlightenment-checkbox"></span>
</label>
</div>
<small class="form-label text-disabled form-description">@_localizer["DescriptionEnableThemeCaching"]</small>
</div>
<div class="form-row" style="justify-content: center;">
<button type="submit" class="confirm-button h-22px">@_localizer["Save"]</button>
</div>
@@ -82,6 +95,7 @@
const checkboxIsPaginationEnabled = document.getElementById('IsPaginationEnabled');
const inputItemsPerPage = document.getElementById('ItemsPerPage');
const checkboxIgnoreThePrefixForAlphaPicker = document.getElementById('IgnoreThePrefixForAlphaPicker');
const checkboxIsThemeCachingEnabled = document.getElementById('IsThemeCachingEnabled');
// toggle the enabled state of the items per page input based on the pagination checkbox
function updateItemsPerPageEnabledState() {
@@ -95,6 +109,7 @@
checkboxIsPaginationEnabled.checked = data.isPaginationEnabled === true;
inputItemsPerPage.value = data.itemsPerPage;
checkboxIgnoreThePrefixForAlphaPicker.checked = data.ignoreThePrefixForAlphaPicker === true;
checkboxIsThemeCachingEnabled.checked = data.isThemeCachingEnabled === true;
updateItemsPerPageEnabledState();
}
}
@@ -104,7 +119,8 @@
const formData = {
IsPaginationEnabled: checkboxIsPaginationEnabled.checked,
ItemsPerPage: Number(inputItemsPerPage.value),
IgnoreThePrefixForAlphaPicker: checkboxIgnoreThePrefixForAlphaPicker.checked
IgnoreThePrefixForAlphaPicker: checkboxIgnoreThePrefixForAlphaPicker.checked,
IsThemeCachingEnabled: checkboxIsThemeCachingEnabled.checked
};
const data = await callApiPostAsync('@_urlService.GetAbsoluteUrl(WebRoutes.Settings.UPDATE_USER_SETTINGS)', formData);
if (data && data.isUpdated === true)