diff --git a/src/GamesLauncher.Platforms/SyncEngines/Amazon/Readers/ProductDetailsReader.cs b/src/GamesLauncher.Platforms/SyncEngines/Amazon/Readers/ProductDetailsReader.cs index 328572b..dbfc91e 100644 --- a/src/GamesLauncher.Platforms/SyncEngines/Amazon/Readers/ProductDetailsReader.cs +++ b/src/GamesLauncher.Platforms/SyncEngines/Amazon/Readers/ProductDetailsReader.cs @@ -1,7 +1,8 @@ using Microsoft.Data.Sqlite; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; using System.Data; -using System.Text.Json; -using System.Text.Json.Nodes; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; namespace GamesLauncher.Platforms.SyncEngines.Amazon.Readers { @@ -38,13 +39,21 @@ FROM game_product_info await using var reader = await command.ExecuteReaderAsync(); while (reader.Read()) { - await using var json = reader.GetStream(0); - var jsonNode = (await JsonSerializer.DeserializeAsync(json))?["ProductIconUrl"]; + var json = reader.GetString(0); - if (jsonNode == null) + var jsonProductIconValue = JsonConvert.DeserializeObject(json, new JsonSerializerSettings + { + Error = delegate (object? sender, ErrorEventArgs args) // When malfunctioned JSON return null + { + args.ErrorContext.Handled = true; + } + }) + ?.Value("ProductIconUrl"); + + if (jsonProductIconValue == null) continue; - return jsonNode.GetValue(); + return jsonProductIconValue; } return fallbackIcon; diff --git a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs index ea9b04c..b2a6b9c 100644 --- a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs +++ b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs @@ -50,13 +50,12 @@ private static async Task> GetEpicGamesFromMetadata() var jObject = JsonConvert.DeserializeObject(fileContent, new JsonSerializerSettings { - Error = delegate (object? sender, ErrorEventArgs args) + Error = delegate (object? sender, ErrorEventArgs args) // When malfunctioned JSON return null { args.ErrorContext.Handled = true; } }); - var game = EpicGame.CreateFromJObject(jObject); if (game != null) diff --git a/src/GamesLauncher.Platforms/SyncEngines/XboxSyncEngine.cs b/src/GamesLauncher.Platforms/SyncEngines/XboxSyncEngine.cs index 3881f0d..85f0724 100644 --- a/src/GamesLauncher.Platforms/SyncEngines/XboxSyncEngine.cs +++ b/src/GamesLauncher.Platforms/SyncEngines/XboxSyncEngine.cs @@ -31,8 +31,6 @@ public async IAsyncEnumerable GetGames() foreach (var game in games) { - var gameTitle = game.DisplayName; - var shellGame = appsFolder.FirstOrDefault(x => x.ParsingName.StartsWith(game.Id.Value)); if (shellGame != null) @@ -40,7 +38,7 @@ public async IAsyncEnumerable GetGames() var cmd = $"shell:appsFolder\\{shellGame.ParsingName}"; yield return new Game( - Title: gameTitle, + Title: shellGame.Name, Platform: PlatformName, RunTask: GetGameRunTask(cmd), IconPath: null, diff --git a/src/GamesLauncher/plugin.json b/src/GamesLauncher/plugin.json index 7bfc725..c70d640 100644 --- a/src/GamesLauncher/plugin.json +++ b/src/GamesLauncher/plugin.json @@ -4,7 +4,7 @@ "Name": "GamesLauncher", "Description": "Search and launch games from multiple platforms like Steam, Epic Games, Xbox etc.", "Author": "KrystianLesniak", - "Version": "1.4.3", + "Version": "1.4.4", "Language": "csharp", "Website": "https://github.com/KrystianLesniak/Flow.Launcher.Plugin.GamesLauncher", "IcoPath": "icon.png",