diff --git a/src/Helldivers-2-Sync/Configuration/HelldiversSyncConfiguration.cs b/src/Helldivers-2-Sync/Configuration/HelldiversSyncConfiguration.cs index 65ca734..3221927 100644 --- a/src/Helldivers-2-Sync/Configuration/HelldiversSyncConfiguration.cs +++ b/src/Helldivers-2-Sync/Configuration/HelldiversSyncConfiguration.cs @@ -30,4 +30,9 @@ public sealed class HelldiversSyncConfiguration /// This is used in CI testing to validate sync works. /// public bool RunOnce { get; set; } = false; + + /// + /// Get the maximum number of entries returned by ArrowHead from the newsfeed API. + /// + public uint NewsFeedMaxEntries { get; set; } = 2048; } diff --git a/src/Helldivers-2-Sync/Services/ArrowHeadApiService.cs b/src/Helldivers-2-Sync/Services/ArrowHeadApiService.cs index 7cb256a..0e2223a 100644 --- a/src/Helldivers-2-Sync/Services/ArrowHeadApiService.cs +++ b/src/Helldivers-2-Sync/Services/ArrowHeadApiService.cs @@ -73,7 +73,11 @@ public async Task> GetWarStatus(string season, string language, Can /// public async Task> 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. @@ -102,7 +106,8 @@ public async Task> LoadAssignments(string season, string language, /// /// Loads space station of a given and in . /// - public async Task> LoadSpaceStations(string season, long id, string language, CancellationToken cancellationToken) + public async Task> 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);