Fixed incorrectly passed parameters for two endpoints.

This commit is contained in:
mmuffins 2018-05-28 22:49:56 +02:00
parent b3f15721f3
commit 9067176dfa
2 changed files with 14 additions and 4 deletions

View File

@ -38,8 +38,13 @@ namespace SteamStorefrontAPI
public static async Task<FeaturedApps> GetAsync(string CountryCode, string Language)
{
string steamUri = steamBaseUri;
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}";
if (!string.IsNullOrWhiteSpace(Language))
{
steamUri += string.IsNullOrWhiteSpace(CountryCode) ? "?" : "&";
steamUri += $"l={Language.ToLower()}";
}
var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; }

View File

@ -38,8 +38,13 @@ namespace SteamStorefrontAPI
public static async Task<List<FeaturedCategory>> GetAsync(string CountryCode, string Language)
{
string steamUri = steamBaseUri;
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}";
if (!string.IsNullOrWhiteSpace(Language))
{
steamUri += string.IsNullOrWhiteSpace(CountryCode) ? "?" : "&";
steamUri += $"l={Language.ToLower()}";
}
var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; }