[CHANGE] Added readme && added service

This commit is contained in:
max
2025-08-31 15:45:42 +02:00
parent a2489fea8d
commit d4d5ef1846
3 changed files with 29 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ using Manager.YouTube.Models.Innertube;
namespace Manager.YouTube;
public sealed class YouTubeClient
public sealed class YouTubeClient : IDisposable
{
public string Id { get; private set; }
public string AccountName { get; private set; }
@@ -39,16 +39,21 @@ public sealed class YouTubeClient
_httpClient = new HttpClient(clientHandler);
}
private async Task GetStateAsync()
public async Task GetStateAsync()
{
var state = await NetworkService.GetClientStateAsync(this);
if (!state.IsSuccess)
{
_logger?.Warning($"Error getting client state: {state.Error}");
_logger?.Warning("Error getting client state: {StateError}", state.Error);
return;
}
ClientState = state.Value;
_logger?.Information("Client state retrieved. With API key: {InnertubeApiKey}", ClientState.InnertubeApiKey);
}
public void Dispose()
{
_httpClient?.Dispose();
}
}

View File

@@ -0,0 +1,6 @@
namespace Manager.YouTube;
public class YouTubeService()
{
}