mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 10:11:10 +00:00
Adds a theme caching toggle to the user settings
This commit is contained in:
1 parent
60b551558f
commit
3da7167538
43 files changed
+1611
-56
No files matched your search
+5
@@ -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>
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ public static class UpdateUserSettingsRequestMapping
|
||||
return new UpdateUserSettingsCommand(
|
||||
request.IsPaginationEnabled,
|
||||
request.ItemsPerPage,
|
||||
request.IgnoreThePrefixForAlphaPicker);
|
||||
request.IgnoreThePrefixForAlphaPicker,
|
||||
request.IsThemeCachingEnabled);
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -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;
|
||||
+4
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user