From 567c64e149f1ec3487dea34abdffc7bfa2f55400 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Wed, 23 Nov 2022 18:55:26 +0100 Subject: [PATCH] ava: Fix JsonSerializer warnings (#3884) Since we move to .NET7, JsonSerializer now needs to have explicit options as arguments, which leads to some warnings in Avalonia project. This is fixed by using our `JsonHelper` class. --- Ryujinx.Ava/Common/Locale/LocaleManager.cs | 3 ++- Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Ryujinx.Ava/Common/Locale/LocaleManager.cs b/Ryujinx.Ava/Common/Locale/LocaleManager.cs index 4275699099..41b9813683 100644 --- a/Ryujinx.Ava/Common/Locale/LocaleManager.cs +++ b/Ryujinx.Ava/Common/Locale/LocaleManager.cs @@ -1,5 +1,6 @@ using Ryujinx.Ava.Ui.ViewModels; using Ryujinx.Common; +using Ryujinx.Common.Utilities; using Ryujinx.Ui.Common.Configuration; using System.Collections.Concurrent; using System.Collections.Generic; @@ -93,7 +94,7 @@ namespace Ryujinx.Ava.Common.Locale return; } - var strings = JsonSerializer.Deserialize>(languageJson); + var strings = JsonHelper.Deserialize>(languageJson); foreach (var item in strings) { diff --git a/Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs index fc809e52ba..d007e0e747 100644 --- a/Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs @@ -8,6 +8,7 @@ using Ryujinx.Ava.Ui.Models; using Ryujinx.Ava.Ui.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; +using Ryujinx.Common.Utilities; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -189,7 +190,7 @@ namespace Ryujinx.Ava.Ui.ViewModels { amiiboJsonString = File.ReadAllText(_amiiboJsonPath); - if (await NeedsUpdate(JsonSerializer.Deserialize(amiiboJsonString).LastUpdated)) + if (await NeedsUpdate(JsonHelper.Deserialize(amiiboJsonString).LastUpdated)) { amiiboJsonString = await DownloadAmiiboJson(); } @@ -206,7 +207,7 @@ namespace Ryujinx.Ava.Ui.ViewModels } } - _amiiboList = JsonSerializer.Deserialize(amiiboJsonString).Amiibo; + _amiiboList = JsonHelper.Deserialize(amiiboJsonString).Amiibo; _amiiboList = _amiiboList.OrderBy(amiibo => amiibo.AmiiboSeries).ToList(); ParseAmiiboData();