From d4d5ef1846ed8592b6339e6475b3414a21ea8943 Mon Sep 17 00:00:00 2001 From: max Date: Sun, 31 Aug 2025 15:45:42 +0200 Subject: [PATCH] [CHANGE] Added readme && added service --- Manager.YouTube/YouTubeClient.cs | 11 ++++++++--- Manager.YouTube/YouTubeService.cs | 6 ++++++ README.md | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 Manager.YouTube/YouTubeService.cs create mode 100644 README.md diff --git a/Manager.YouTube/YouTubeClient.cs b/Manager.YouTube/YouTubeClient.cs index abb256c..c0ac540 100644 --- a/Manager.YouTube/YouTubeClient.cs +++ b/Manager.YouTube/YouTubeClient.cs @@ -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(); + } } \ No newline at end of file diff --git a/Manager.YouTube/YouTubeService.cs b/Manager.YouTube/YouTubeService.cs new file mode 100644 index 0000000..14c398c --- /dev/null +++ b/Manager.YouTube/YouTubeService.cs @@ -0,0 +1,6 @@ +namespace Manager.YouTube; + +public class YouTubeService() +{ + +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..34699a5 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# YouTube Manager +Server application for managing YouTube content and managing a local library. + +### Migrations +Using migrations using the .NET CLI + +Add migration +```shell +dotnet ef migrations add --project Manager.Data --context Manager.Data.Contexts.AppDbContext +``` +Update the database +```shell +dotnet ef database update --project Manager.Data --context Manager.Data.Contexts.AppDbContext +``` +