diff --git a/src/Snap.Hutao/Snap.Hutao/Core/ExceptionService/HutaoException.cs b/src/Snap.Hutao/Snap.Hutao/Core/ExceptionService/HutaoException.cs index f46622a7..7bf282e8 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/ExceptionService/HutaoException.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/ExceptionService/HutaoException.cs @@ -28,21 +28,20 @@ internal sealed class HutaoException : Exception { if (!condition) { - throw new HutaoException(kind, message, innerException); + throw new HutaoException(message, innerException); } } [DoesNotReturn] public static HutaoException GachaStatisticsInvalidItemId(uint id, Exception? innerException = default) { - string message = SH.FormatServiceGachaStatisticsFactoryItemIdInvalid(id); - throw new HutaoException(HutaoExceptionKind.GachaStatisticsInvalidItemId, message, innerException); + throw new HutaoException(SH.FormatServiceGachaStatisticsFactoryItemIdInvalid(id), innerException); } [DoesNotReturn] public static HutaoException UserdataCorrupted(string message, Exception? innerException = default) { - throw new HutaoException(HutaoExceptionKind.UserdataCorrupted, message, innerException); + throw new HutaoException(message, innerException); } [DoesNotReturn] diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/Achievement/AchievementViewModelSlim.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/Achievement/AchievementViewModelSlim.cs index e616a297..67803ae3 100644 --- a/src/Snap.Hutao/Snap.Hutao/ViewModel/Achievement/AchievementViewModelSlim.cs +++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/Achievement/AchievementViewModelSlim.cs @@ -4,6 +4,7 @@ using Snap.Hutao.Model.Primitive; using Snap.Hutao.Service.Achievement; using Snap.Hutao.Service.Metadata; +using Snap.Hutao.Service.Metadata.ContextAbstraction; namespace Snap.Hutao.ViewModel.Achievement; @@ -31,12 +32,12 @@ internal sealed partial class AchievementViewModelSlim : Abstraction.ViewModelSl if (await metadataService.InitializeAsync().ConfigureAwait(false)) { - Dictionary achievementMap = await metadataService - .GetIdToAchievementMapAsync() + AchievementServiceMetadataContext context = await metadataService + .GetContextAsync() .ConfigureAwait(false); List list = await scope.ServiceProvider .GetRequiredService() - .GetAchievementStatisticsAsync(achievementMap) + .GetAchievementStatisticsAsync(context) .ConfigureAwait(false); await taskContext.SwitchToMainThreadAsync();