From e499b0a992c139fdd4073e6bf6f889d9ef372002 Mon Sep 17 00:00:00 2001 From: Allex Rodrigues Date: Sun, 1 Nov 2020 22:03:55 -0300 Subject: [PATCH] Fix steamgriddb api calls not sending query params --- UWPHook/SteamGridDb/SteamGridDbApi.cs | 48 +++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/UWPHook/SteamGridDb/SteamGridDbApi.cs b/UWPHook/SteamGridDb/SteamGridDbApi.cs index 715e634..632cda5 100644 --- a/UWPHook/SteamGridDb/SteamGridDbApi.cs +++ b/UWPHook/SteamGridDb/SteamGridDbApi.cs @@ -45,7 +45,22 @@ namespace UWPHook.SteamGridDb string nsfw = "any", string humor = "any") { - string path = $"grids/game/{gameId}"; + string path = $"grids/game/{gameId}?"; + + if (!String.IsNullOrEmpty(dimensions)) + path += $"dimensions={dimensions}&"; + + if (!String.IsNullOrEmpty(types)) + path += $"types={types}&"; + + if (!String.IsNullOrEmpty(styles)) + path += $"styles={styles}&"; + + if (!String.IsNullOrEmpty(nsfw)) + path += $"nsfw={nsfw}&"; + + if (!String.IsNullOrEmpty(humor)) + path += $"humor={humor}&"; GridResponse[] grids = null; HttpResponseMessage response = await httpClient.GetAsync(path); @@ -67,7 +82,22 @@ namespace UWPHook.SteamGridDb string nsfw = "any", string humor = "any") { - string path = $"heroes/game/{gameId}"; + string path = $"heroes/game/{gameId}?"; + + if (!String.IsNullOrEmpty(dimensions)) + path += $"dimensions={dimensions}&"; + + if (!String.IsNullOrEmpty(types)) + path += $"types={types}&"; + + if (!String.IsNullOrEmpty(styles)) + path += $"styles={styles}&"; + + if (!String.IsNullOrEmpty(nsfw)) + path += $"nsfw={nsfw}&"; + + if (!String.IsNullOrEmpty(humor)) + path += $"humor={humor}&"; HeroResponse[] heroes = null; HttpResponseMessage response = await httpClient.GetAsync(path); @@ -88,7 +118,19 @@ namespace UWPHook.SteamGridDb string nsfw = "any", string humor = "any") { - string path = $"logos/game/{gameId}"; + string path = $"logos/game/{gameId}?"; + + if (!String.IsNullOrEmpty(types)) + path += $"types={types}&"; + + if (!String.IsNullOrEmpty(styles)) + path += $"styles={styles}&"; + + if (!String.IsNullOrEmpty(nsfw)) + path += $"nsfw={nsfw}&"; + + if (!String.IsNullOrEmpty(humor)) + path += $"humor={humor}&"; LogoResponse[] logos = null; HttpResponseMessage response = await httpClient.GetAsync(path);