13
13
using System . IO ;
14
14
using System . Reflection ;
15
15
using System . Linq ;
16
- using System . Threading ;
17
16
using Newtonsoft . Json . Linq ;
18
17
using RomM . Settings ;
19
18
using Playnite . SDK . Events ;
20
19
using RomM . Games ;
21
- using System . Security ;
22
20
23
21
24
22
namespace RomM
@@ -211,8 +209,9 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
211
209
212
210
JArray apiPlatforms = FetchPlatforms ( ) ;
213
211
List < GameMetadata > games = new List < GameMetadata > ( ) ;
212
+ IEnumerable < EmulatorMapping > enabledMappings = SettingsViewModel . Instance . Mappings ? . Where ( m => m . Enabled ) ;
214
213
215
- foreach ( var mapping in SettingsViewModel . Instance . Mappings ? . Where ( m => m . Enabled ) )
214
+ foreach ( var mapping in enabledMappings )
216
215
{
217
216
if ( args . CancelToken . IsCancellationRequested )
218
217
break ;
@@ -246,7 +245,7 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
246
245
247
246
NameValueCollection queryParams = new NameValueCollection
248
247
{
249
- { "size " , "10000" } ,
248
+ { "limit " , "10000" } ,
250
249
{ "platform_id" , apiPlatform [ "id" ] . ToString ( ) }
251
250
} ;
252
251
@@ -259,8 +258,8 @@ public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
259
258
260
259
// Assuming the response is in JSON format
261
260
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 ( ) ;
264
263
var installDir = PlayniteApi . Paths . IsPortable ? mapping . DestinationPathResolved . Replace ( PlayniteApi . Paths . ApplicationPath , ExpandableVariables . PlayniteDirectory ) : mapping . DestinationPathResolved ;
265
264
266
265
// Return a GameMetadata for each item in the response
0 commit comments