Redid stores. Added user store. Added Channel Manager, to manage data from a single channel.

This commit is contained in:
Tom
2024-10-19 01:50:46 +00:00
parent 3f3ba63554
commit 4d0b38babd
22 changed files with 654 additions and 475 deletions

View File

@@ -1,5 +1,6 @@
using System.Text.Json;
using HermesSocketLibrary.Requests;
using HermesSocketServer.Models;
using HermesSocketServer.Store;
using ILogger = Serilog.ILogger;
@@ -8,7 +9,7 @@ namespace HermesSocketServer.Requests
public class CreateTTSVoice : IRequest
{
public string Name => "create_tts_voice";
private IStore<string, string> _voices;
private IStore<string, Voice> _voices;
private ILogger _logger;
private Random _random;
@@ -35,7 +36,11 @@ namespace HermesSocketServer.Requests
string id = RandomString(25);
_voices.Set(id, data["voice"].ToString());
_voices.Set(id, new Voice()
{
Id = id,
Name = data["voice"].ToString()!
});
_logger.Information($"Added a new voice [voice: {data["voice"]}][voice id: {id}]");
return new RequestResult(true, id);