Skip to content

Commit 0501e71

Browse files
committedJun 8, 2024
fix crash from API changes in 3.2.0 release
1 parent e2aa214 commit 0501e71

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed
 

‎RomM.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
using System.IO;
1414
using System.Reflection;
1515
using System.Linq;
16-
using System.Threading;
1716
using Newtonsoft.Json.Linq;
1817
using RomM.Settings;
1918
using Playnite.SDK.Events;
2019
using RomM.Games;
21-
using System.Security;
2220

2321

2422
namespace RomM
@@ -211,8 +209,9 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
211209

212210
JArray apiPlatforms = FetchPlatforms();
213211
List<GameMetadata> games = new List<GameMetadata>();
212+
IEnumerable<EmulatorMapping> enabledMappings = SettingsViewModel.Instance.Mappings?.Where(m => m.Enabled);
214213

215-
foreach (var mapping in SettingsViewModel.Instance.Mappings?.Where(m => m.Enabled))
214+
foreach (var mapping in enabledMappings)
216215
{
217216
if (args.CancelToken.IsCancellationRequested)
218217
break;
@@ -246,7 +245,7 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
246245

247246
NameValueCollection queryParams = new NameValueCollection
248247
{
249-
{ "size", "10000" },
248+
{ "limit", "10000" },
250249
{ "platform_id", apiPlatform["id"].ToString() }
251250
};
252251

@@ -259,8 +258,8 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
259258

260259
// Assuming the response is in JSON format
261260
string body = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
262-
JObject jsonObject = JObject.Parse(body);
263-
var items = jsonObject["items"].Children();
261+
JArray jsonObject = JArray.Parse(body);
262+
var items = jsonObject.Children();
264263
var installDir = PlayniteApi.Paths.IsPortable ? mapping.DestinationPathResolved.Replace(PlayniteApi.Paths.ApplicationPath, ExpandableVariables.PlayniteDirectory) : mapping.DestinationPathResolved;
265264

266265
// Return a GameMetadata for each item in the response

‎extension.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Id: RomM_9700aa21-447d-41b4-a989-acd38f407d9f
22
Name: RomM Library Importer
33
Author: The RomM Team
4-
Version: 0.2.2
4+
Version: 0.2.3
55
Module: RomM.dll
66
Type: GameLibrary
77
Icon: icon.png

‎manifests/installer.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ Packages:
1212
PackageUrl: https://github.com/rommapp/playnite-plugin/releases/download/v0.2.2/RomM_9700aa21-447d-41b4-a989-acd38f407d9f_0_2_2.pext
1313
Changelog:
1414
- Fix crashes when null igdb_id is returned from RomM for platform
15+
- Version: 0.2.3
16+
RequiredApiVersion: 6.11.0
17+
ReleaseDate: 2024-06-08
18+
PackageUrl: https://github.com/rommapp/playnite-plugin/releases/download/v0.2.3/RomM_9700aa21-447d-41b4-a989-acd38f407d9f_0_2_3.pext
19+
Changelog:
20+
- Update for API changes in 3.2.0 release of RomM

0 commit comments

Comments
 (0)
Please sign in to comment.