[CHANGE] Added readme && added service
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
6
Manager.YouTube/YouTubeService.cs
Normal file
6
Manager.YouTube/YouTubeService.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Manager.YouTube;
|
||||||
|
|
||||||
|
public class YouTubeService()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
15
README.md
Normal file
15
README.md
Normal 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
|
||||||
|
```
|
||||||
|
|
Reference in New Issue
Block a user