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

15
README.md Normal file
View File

@@ -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 <MigrationName> --project Manager.Data --context Manager.Data.Contexts.AppDbContext
```
Update the database
```shell
dotnet ef database update --project Manager.Data --context Manager.Data.Contexts.AppDbContext
```