Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public sealed class HelldiversSyncConfiguration
/// This is used in CI testing to validate sync works.
/// </summary>
public bool RunOnce { get; set; } = false;

/// <summary>
/// Get the maximum number of entries returned by ArrowHead from the newsfeed API.
/// </summary>
public uint NewsFeedMaxEntries { get; set; } = 2048;
}
9 changes: 7 additions & 2 deletions src/Helldivers-2-Sync/Services/ArrowHeadApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public async Task<Memory<byte>> GetWarStatus(string season, string language, Can
/// </summary>
public async Task<Memory<byte>> LoadFeed(string season, string language, CancellationToken cancellationToken)
{
var request = BuildRequest($"/api/NewsFeed/{season}", language);
// If the `NewsFeedMaxEntries` flag is not set to 0 we pass it in.
var request = options.Value.NewsFeedMaxEntries is 0
? BuildRequest($"/api/NewsFeed/{season}", language)
: BuildRequest($"/api/NewsFeed/{season}?maxEntries=${options.Value.NewsFeedMaxEntries}", language);

using var response = await http.SendAsync(request, cancellationToken);

// Throw on error responses so we don't have to look down the entire serialisation tree.
Expand Down Expand Up @@ -102,7 +106,8 @@ public async Task<Memory<byte>> LoadAssignments(string season, string language,
/// <summary>
/// Loads space station of a given <paramref name="season" /> and <paramref name="id"/> in <paramref name="language" />.
/// </summary>
public async Task<Memory<byte>> LoadSpaceStations(string season, long id, string language, CancellationToken cancellationToken)
public async Task<Memory<byte>> LoadSpaceStations(string season, long id, string language,
CancellationToken cancellationToken)
{
var request = BuildRequest($"/api/SpaceStation/{season}/{id}", language);
using var response = await http.SendAsync(request, cancellationToken);
Expand Down