From 8991a0eb32cd5eb36101c396f61d14db72b5ebf5 Mon Sep 17 00:00:00 2001 From: Dinesh Solanki <15937452+DineshSolanki@users.noreply.github.com> Date: Sat, 7 Aug 2021 12:47:53 +0530 Subject: [PATCH] added method to searchArtworkByGameID --- FoliCon/Modules/IGDBClass.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FoliCon/Modules/IGDBClass.cs b/FoliCon/Modules/IGDBClass.cs index e4239351..bb2fa6e3 100644 --- a/FoliCon/Modules/IGDBClass.cs +++ b/FoliCon/Modules/IGDBClass.cs @@ -43,6 +43,7 @@ public async Task SearchGameAsync(string query) Contract.Assert(_serviceClient != null); var r = await _serviceClient.QueryAsync(IGDBClient.Endpoints.Games, $"search \"{query}\"; fields artworks.image_id, name,first_release_date,total_rating,summary,cover.*;"); + var response = new ResultResponse { MediaType = MediaTypes.Game, @@ -65,9 +66,9 @@ public async Task SearchGameByIdAsync(string id) public async Task GetArtworksByGameIdAsync(string id) { - var r = await _serviceClient.QueryAsync(IGDBClient.Endpoints.Games, - $"fields id, artworks.image_id; where id = {id};"); - return r.First().Artworks.Values; + var r = await _serviceClient.QueryAsync(IGDBClient.Endpoints.Artworks, + $"fields image_id; where game = {id};"); + return r; } public static ObservableCollection ExtractGameDetailsIntoListItem(Game[] result) {