From a17a3af282a073fa969abff61416dc586aede4b3 Mon Sep 17 00:00:00 2001 From: "krystian.lesniak" Date: Sun, 1 Oct 2023 18:02:05 +0200 Subject: [PATCH 1/5] Epic Sync Engine: Add comment for error JSON deserialize handler --- src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs index ea9b04c..771e03f 100644 --- a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs +++ b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs @@ -50,7 +50,7 @@ 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; } From e2c5f090e4c8164d8baa112084a83d4df0d7e87a Mon Sep 17 00:00:00 2001 From: "krystian.lesniak" Date: Sun, 1 Oct 2023 18:04:19 +0200 Subject: [PATCH 2/5] Amazon Sync Engine: Use Newtonsoft.Json instead of System.Text.Json --- .../Amazon/Readers/ProductDetailsReader.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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; From 76897d7e9e172de551dc3e3288e42746d4b2d615 Mon Sep 17 00:00:00 2001 From: "krystian.lesniak" Date: Sat, 7 Oct 2023 15:59:33 +0200 Subject: [PATCH 3/5] Remove unnecessery blank line --- src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs index 771e03f..b2a6b9c 100644 --- a/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs +++ b/src/GamesLauncher.Platforms/SyncEngines/Epic/EpicSyncEngine.cs @@ -56,7 +56,6 @@ private static async Task> GetEpicGamesFromMetadata() } }); - var game = EpicGame.CreateFromJObject(jObject); if (game != null) From ca1b7a998b3d537366b7629e712a8d0b5410636e Mon Sep 17 00:00:00 2001 From: "krystian.lesniak" Date: Tue, 10 Oct 2023 17:46:42 +0200 Subject: [PATCH 4/5] Bug Fix: Xbox: Not listing some game titles properly --- src/GamesLauncher.Platforms/SyncEngines/XboxSyncEngine.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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, From ddb9c3f78eca0f45d8148a5f0982768715322a86 Mon Sep 17 00:00:00 2001 From: "krystian.lesniak" Date: Tue, 10 Oct 2023 17:47:05 +0200 Subject: [PATCH 5/5] Bumped version to 1.4.4 --- src/GamesLauncher/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",