This commit is contained in:
Casper Sparre 2025-05-21 18:11:22 +02:00
parent fd14259aa0
commit 5b285acb37

View File

@ -13,6 +13,7 @@ using OF_DL.Enumerations;
using OF_DL.Enumurations;
using Serilog;
using Spectre.Console;
using System.Diagnostics;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
@ -127,6 +128,10 @@ public class APIHelper : IAPIHelper
{
HttpRequestMessage request = await BuildHttpRequestMessage(getParams, endpoint);
using var response = await client.SendAsync(request);
if (response.StatusCode == System.Net.HttpStatusCode.TooManyRequests)
Debugger.Break();
response.EnsureSuccessStatusCode();
string body = await response.Content.ReadAsStringAsync();
@ -469,12 +474,16 @@ public class APIHelper : IAPIHelper
try
{
int limit = 50;
int offset = 0;
Dictionary<string, string> getParams = new()
{
{ "limit", limit.ToString() },
{ "offset", offset.ToString() },
{ "limit", "50" }
{ "format", "infinite"}
};
List<string> users = new();
while (true)
@ -485,6 +494,8 @@ public class APIHelper : IAPIHelper
break;
}
UserList? userList = JsonConvert.DeserializeObject<UserList>(body, m_JsonSerializerSettings);
List<UsersList>? usersList = JsonConvert.DeserializeObject<List<UsersList>>(body);
if (usersList == null || usersList.Count <= 0)
@ -506,6 +517,7 @@ public class APIHelper : IAPIHelper
getParams["offset"] = Convert.ToString(offset);
}
return users;
}
catch (Exception ex)