Revised the redeem system, activated via channel point redeems. Added OBS transformation to redeems. Logs changed & writes to logs folder as well. Removed most use of IServiceProvider.

This commit is contained in:
Tom
2024-06-24 22:11:36 +00:00
parent 706cd06930
commit 706eecf2d2
45 changed files with 964 additions and 577 deletions

View File

@ -5,8 +5,8 @@ namespace TwitchChatTTS.Helpers
{
public class WebClientWrap
{
private HttpClient _client;
private JsonSerializerOptions _options;
private readonly HttpClient _client;
private readonly JsonSerializerOptions _options;
public WebClientWrap(JsonSerializerOptions options)
@ -23,10 +23,10 @@ namespace TwitchChatTTS.Helpers
_client.DefaultRequestHeaders.Add(key, value);
}
public async Task<T?> GetJson<T>(string uri)
public async Task<T?> GetJson<T>(string uri, JsonSerializerOptions options = null)
{
var response = await _client.GetAsync(uri);
return JsonSerializer.Deserialize<T>(await response.Content.ReadAsStreamAsync(), _options);
return JsonSerializer.Deserialize<T>(await response.Content.ReadAsStreamAsync(), options ?? _options);
}
public async Task<HttpResponseMessage> Get(string uri)