Update to the Settings interface.

- Methods are now suffixed async
- Extension methods moved to the actual class and class renamed from SettingValue to Setting
- "Helpers" renamed to "SettingsProvider"
- Removed the ghetto CSV list method. Only setting using it was Pusher Channels which was orphaned by the new Kick channel feature. The call to ToList in the Chips.gg integration was incorrect and just proves lists should be consistently based around JSON objects instead of randomly string splitting
This commit is contained in:
barelyprofessional
2025-05-06 14:07:52 -05:00
parent 4fecdbce06
commit e2c70cc5c5
17 changed files with 167 additions and 229 deletions

View File

@@ -21,7 +21,7 @@ public class KfTokenService
_kiwiFlare = new KiwiFlare(kfDomain, proxy, cancellationToken);
_proxy = proxy;
_kfDomain = kfDomain;
var cachedCookies = Helpers.GetValue(BuiltIn.Keys.KiwiFarmsCookies).Result
var cachedCookies = SettingsProvider.GetValueAsync(BuiltIn.Keys.KiwiFarmsCookies).Result
.JsonDeserialize<Dictionary<string, string>>();
// This shouldn't happen as the setting's default value is {}, but I'm just doing it to shut the IDE up
if (cachedCookies == null) return;
@@ -161,7 +161,7 @@ public class KfTokenService
{
_logger.Debug("Saving cookies");
var cookiesToSave = _cookies.GetAllCookies().ToDictionary(cookie => cookie.Name, cookie => cookie.Value);
await Helpers.SetValueAsJsonObject(BuiltIn.Keys.KiwiFarmsCookies, cookiesToSave);
await SettingsProvider.SetValueAsJsonObjectAsync(BuiltIn.Keys.KiwiFarmsCookies, cookiesToSave);
}
public void WipeCookies()