Skip to content

Commit 3af4a2c

Browse files
author
Justin Skiles
committed
Added language parameter to store app details. Removed obsolete method/endpoint.
1 parent 3d1340c commit 3af4a2c

File tree

6 files changed

+12
-40
lines changed

6 files changed

+12
-40
lines changed

src/Steam.UnitTests/PlayerServiceTests.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ public PlayerServiceTests()
1919
steamInterface = factory.CreateSteamWebInterface<PlayerService>(new HttpClient());
2020
}
2121

22-
[Fact]
23-
public async Task IsPlayingSharedGameAsync_Should_Succeed()
24-
{
25-
var response = await steamInterface.IsPlayingSharedGameAsync(76561198050013009, 440);
26-
Assert.NotNull(response);
27-
Assert.NotNull(response.Data);
28-
}
29-
3022
[Fact]
3123
public async Task GetCommunityBadgeProgressAsync_Should_Succeed()
3224
{

src/Steam.UnitTests/SteamStoreTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,13 @@ public async Task GetStoreAppDetailsAsync_WithCurrency_Should_Succeed()
3838
Assert.NotNull(response.PriceOverview?.Currency);
3939
Assert.Equal("MXN", response.PriceOverview.Currency);
4040
}
41+
42+
[Fact]
43+
public async Task GetStoreAppDetailsAsync_WithLanguage_Should_Succeed()
44+
{
45+
var response = await steamStore.GetStoreAppDetailsAsync(1086940, "german");
46+
Assert.NotNull(response);
47+
Assert.NotNull(response.Name);
48+
}
4149
}
4250
}

src/SteamWebAPI2/Interfaces/IPlayerService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ public interface IPlayerService
1616
Task<ISteamWebResponse<RecentlyPlayedGamesResultModel>> GetRecentlyPlayedGamesAsync(ulong steamId);
1717

1818
Task<ISteamWebResponse<uint?>> GetSteamLevelAsync(ulong steamId);
19-
20-
Task<ISteamWebResponse<ulong?>> IsPlayingSharedGameAsync(ulong steamId, uint appId);
2119
}
2220
}

src/SteamWebAPI2/Interfaces/ISteamStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace SteamWebAPI2.Interfaces
55
{
66
internal interface ISteamStore
77
{
8-
Task<StoreAppDetailsDataModel> GetStoreAppDetailsAsync(uint appId, string cc = "");
8+
Task<StoreAppDetailsDataModel> GetStoreAppDetailsAsync(uint appId, string cc = "", string language = "");
99

1010
Task<StoreFeaturedCategoriesModel> GetStoreFeaturedCategoriesAsync();
1111

src/SteamWebAPI2/Interfaces/PlayerService.cs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,7 @@ public PlayerService(IMapper mapper, ISteamWebRequest steamWebRequest, ISteamWeb
2828
? new SteamWebInterface("IPlayerService", steamWebRequest)
2929
: steamWebInterface;
3030
}
31-
32-
/// <summary>
33-
/// Returns a message which indicates if a player is playing a shared game (from their shared Steam library).
34-
/// </summary>
35-
/// <param name="steamId"></param>
36-
/// <param name="appId"></param>
37-
/// <returns></returns>
38-
public async Task<ISteamWebResponse<ulong?>> IsPlayingSharedGameAsync(ulong steamId, uint appId)
39-
{
40-
List<SteamWebRequestParameter> parameters = new List<SteamWebRequestParameter>();
41-
42-
parameters.AddIfHasValue(steamId, "steamid");
43-
parameters.AddIfHasValue(appId, "appid_playing");
44-
45-
var steamWebResponse = await steamWebInterface.GetAsync<PlayingSharedGameResultContainer>("IsPlayingSharedGame", 1, parameters);
46-
47-
if (steamWebResponse == null)
48-
{
49-
return null;
50-
}
51-
52-
var steamWebResponseModel = mapper.Map<
53-
ISteamWebResponse<PlayingSharedGameResultContainer>,
54-
ISteamWebResponse<ulong?>>(steamWebResponse);
55-
56-
return steamWebResponseModel;
57-
}
58-
31+
5932
/// <summary>
6033
/// Returns a collection of badge meta data which indicates the progress towards a badge for a specific user.
6134
/// </summary>

src/SteamWebAPI2/Interfaces/SteamStore.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ public SteamStore(IMapper mapper, HttpClient httpClient) : base(mapper, httpClie
2323
/// </summary>
2424
/// <param name="appId"></param>
2525
/// <returns></returns>
26-
public async Task<StoreAppDetailsDataModel> GetStoreAppDetailsAsync(uint appId, string cc = "")
26+
public async Task<StoreAppDetailsDataModel> GetStoreAppDetailsAsync(uint appId, string cc = "", string language = "")
2727
{
2828
List<SteamWebRequestParameter> parameters = new List<SteamWebRequestParameter>();
2929

3030
parameters.AddIfHasValue(appId, "appids");
3131
parameters.AddIfHasValue(cc, "cc");
32+
parameters.AddIfHasValue(language, "l");
3233

3334
var appDetails = await CallMethodAsync<AppDetailsContainer>("appdetails", parameters);
3435

0 commit comments

Comments
 (0)