Skip to content

Commit 7f194c1

Browse files
authored
Bugfix/issue 108 (#109)
* Accommodate Changes to Add "Feeds" and "Tags" as SteamNews Parameters Feeds is a string and Tags is a string array. The changes passed unit tests. * Adding Parameter Examples Shows that the parameters actually filter down the results.
1 parent 95666b0 commit 7f194c1

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

src/Steam.Models/NewsItemModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ public class NewsItemModel
1919
public ulong Date { get; set; }
2020

2121
public string Feedname { get; set; }
22+
23+
public string[] Tags { get; set; }
2224
}
2325
}

src/SteamWebAPI2/Interfaces/ISteamNews.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ namespace SteamWebAPI2.Interfaces
77
{
88
public interface ISteamNews
99
{
10-
Task<ISteamWebResponse<SteamNewsResultModel>> GetNewsForAppAsync(uint appId, uint? maxLength = null, DateTime? endDate = null, uint? count = null);
10+
Task<ISteamWebResponse<SteamNewsResultModel>> GetNewsForAppAsync(uint appId, uint? maxLength = null, DateTime? endDate = null, uint? count = null, string feeds = null, string[] tags = null);
1111
}
1212
}

src/SteamWebAPI2/Interfaces/SteamNews.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ public SteamNews(IMapper mapper, ISteamWebRequest steamWebRequest, ISteamWebInte
3333
/// <param name="maxLength"></param>
3434
/// <param name="endDate"></param>
3535
/// <param name="count"></param>
36+
/// <param name="feeds"></param>
37+
/// <param name="tags"></param>
3638
/// <returns></returns>
37-
public async Task<ISteamWebResponse<SteamNewsResultModel>> GetNewsForAppAsync(uint appId, uint? maxLength = null, DateTime? endDate = null, uint? count = null)
39+
public async Task<ISteamWebResponse<SteamNewsResultModel>> GetNewsForAppAsync(uint appId, uint? maxLength = null, DateTime? endDate = null, uint? count = null, string feeds = null, string[] tags = null)
3840
{
3941
ulong? endDateUnixTimeStamp = null;
4042

@@ -49,6 +51,8 @@ public async Task<ISteamWebResponse<SteamNewsResultModel>> GetNewsForAppAsync(ui
4951
parameters.AddIfHasValue(maxLength, "maxlength");
5052
parameters.AddIfHasValue(endDateUnixTimeStamp, "enddate");
5153
parameters.AddIfHasValue(count, "count");
54+
parameters.AddIfHasValue(feeds, "feeds");
55+
parameters.AddIfHasValue(tags, "tags");
5256

5357
var steamWebResponse = await steamWebInterface.GetAsync<SteamNewsResultContainer>("GetNewsForApp", 2, parameters);
5458

src/SteamWebAPI2/Models/SteamNewsResultContainer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ internal class NewsItem
3131

3232
[JsonProperty("feedname")]
3333
public string Feedname { get; set; }
34+
35+
[JsonProperty("tags")]
36+
public string[] Tags { get; set; }
3437
}
3538

3639
internal class SteamNewsResult

src/SteamWebAPI2/Utilities/SteamWebRequest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ private async Task<ISteamWebResponse<T>> SendWebRequestAsync<T>(HttpMethod httpM
110110
}
111111

112112
parameters.Insert(0, new SteamWebRequestParameter("key", steamWebApiKey));
113+
//parameters.Insert(0, new SteamWebRequestParameter("feeds", "SteamDB")); -- Demonstration of Implementing Feeds Parameter
114+
//parameters.Insert(0, new SteamWebRequestParameter("tags", "halloween")); -- Demonstration of Implementing Tags Parameter
113115

114116
HttpResponseMessage httpResponse = null;
115117

0 commit comments

Comments
 (0)