mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix build
This commit is contained in:
@@ -143,10 +143,11 @@ internal sealed class NotifyIconMessageWindow : IDisposable
|
||||
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
[UnconditionalSuppressMessage("", "CS0649")]
|
||||
private readonly struct LPARAM2
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public readonly uint Low;
|
||||
public readonly uint High;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ internal sealed class AppDbContextDesignTimeFactory : IDesignTimeDbContextFactor
|
||||
string userdataDbName = @"D:\Hutao\Userdata.db";
|
||||
return AppDbContext.Create(default!, $"Data Source={userdataDbName}");
|
||||
#else
|
||||
throw Must.NeverHappen();
|
||||
throw Core.ExceptionService.HutaoException.NotSupported();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,29 +48,9 @@ internal sealed partial class DailyNoteNotificationOperation
|
||||
return;
|
||||
}
|
||||
|
||||
string? attribution = SH.ServiceDailyNoteNotifierAttribution;
|
||||
|
||||
if (entry.UserGameRole is not null)
|
||||
{
|
||||
attribution = entry.UserGameRole.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Response<ListWrapper<UserGameRole>> rolesResponse;
|
||||
using (IServiceScope scope = serviceScopeFactory.CreateScope())
|
||||
{
|
||||
BindingClient bindingClient = scope.ServiceProvider.GetRequiredService<BindingClient>();
|
||||
rolesResponse = await bindingClient
|
||||
.GetUserGameRolesOverseaAwareAsync(entry.User)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (rolesResponse.IsOk())
|
||||
{
|
||||
List<UserGameRole> roles = rolesResponse.Data.List;
|
||||
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
|
||||
}
|
||||
}
|
||||
string attribution = entry.UserGameRole is not null
|
||||
? entry.UserGameRole.ToString()
|
||||
: await GetUserUidAsync(entry).ConfigureAwait(false);
|
||||
|
||||
ToastContentBuilder builder = new ToastContentBuilder()
|
||||
.AddHeader(ToastHeaderIdArgument, SH.ServiceDailyNoteNotifierTitle, ToastHeaderIdArgument)
|
||||
@@ -130,4 +110,24 @@ internal sealed partial class DailyNoteNotificationOperation
|
||||
// Prevent notify when we are in game && silent mode.
|
||||
return options.IsSilentWhenPlayingGame && gameService.IsGameRunning();
|
||||
}
|
||||
|
||||
private async ValueTask<string> GetUserUidAsync(DailyNoteEntry entry)
|
||||
{
|
||||
Response<ListWrapper<UserGameRole>> rolesResponse;
|
||||
using (IServiceScope scope = serviceScopeFactory.CreateScope())
|
||||
{
|
||||
BindingClient bindingClient = scope.ServiceProvider.GetRequiredService<BindingClient>();
|
||||
rolesResponse = await bindingClient
|
||||
.GetUserGameRolesOverseaAwareAsync(entry.User)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (rolesResponse.IsOk())
|
||||
{
|
||||
List<UserGameRole> roles = rolesResponse.Data.List;
|
||||
return roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
|
||||
}
|
||||
|
||||
return SH.ServiceDailyNoteNotifierAttribution;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ internal static class NotifySuppressionInvoker
|
||||
context.Invoke<ExpeditionNotifySuppressionChecker>();
|
||||
}
|
||||
|
||||
[SuppressMessage("", "CA1859")]
|
||||
private static void Invoke<T>(this INotifySuppressionContext context)
|
||||
where T : INotifySuppressionChecker, new()
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ internal sealed partial class GachaStatisticsFactory : IGachaStatisticsFactory
|
||||
HomaGachaLogClient gachaLogClient,
|
||||
List<Model.Entity.GachaItem> items,
|
||||
List<HistoryWishBuilder> historyWishBuilders,
|
||||
in GachaLogServiceMetadataContext context,
|
||||
GachaLogServiceMetadataContext context,
|
||||
AppOptions appOptions)
|
||||
{
|
||||
TypedWishSummaryBuilderContext standardContext = TypedWishSummaryBuilderContext.StandardWish(taskContext, gachaLogClient);
|
||||
|
||||
@@ -191,7 +191,7 @@ internal class MiHoYoJSBridge
|
||||
Data = new()
|
||||
{
|
||||
["language"] = cultureOptions.LanguageCode,
|
||||
["timeZone"] = $"GMT{(offset.Hours >= 0 ? "+" : " - ")}{offset.Hours:D1}",
|
||||
["timeZone"] = $"GMT{(offset.Hours >= 0 ? "+" : " - ")}{Math.Abs(offset.Hours):D1}",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user