36 lines
919 B
C#
36 lines
919 B
C#
using DotBased.Monads;
|
|
using Manager.YouTube;
|
|
|
|
namespace Manager.App.Services.System;
|
|
|
|
public class ClientManager : BackgroundService
|
|
{
|
|
private readonly List<YouTubeClient> _clients = [];
|
|
private CancellationToken _cancellationToken;
|
|
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
_cancellationToken = stoppingToken;
|
|
stoppingToken.Register(CancellationRequested);
|
|
}
|
|
|
|
private void CancellationRequested()
|
|
{
|
|
// Clear up
|
|
}
|
|
|
|
public async Task<Result> SaveClientAsync(YouTubeClient client)
|
|
{
|
|
return ResultError.Fail("Not implemented");
|
|
}
|
|
|
|
public async Task<Result<YouTubeClient>> LoadClientByIdAsync(string id)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(id))
|
|
{
|
|
return ResultError.Fail("Client ID is empty!");
|
|
}
|
|
|
|
return ResultError.Fail("Not implemented");
|
|
}
|
|
} |