[CHANGE] Services view
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
using Manager.App.Models.System;
|
||||
|
||||
namespace Manager.App.Services.System;
|
||||
|
||||
public class BackgroundServiceManager
|
||||
@@ -11,13 +9,8 @@ public class BackgroundServiceManager
|
||||
_backgroundServices.Add(service);
|
||||
}
|
||||
|
||||
public ListResult<ExtendedBackgroundService> GetServices(string serviceName, int total = 20, int skip = 0)
|
||||
public List<ExtendedBackgroundService> GetServices()
|
||||
{
|
||||
var filtered = string.IsNullOrWhiteSpace(serviceName) ? _backgroundServices.ToArray() : _backgroundServices.Where(x => x.Name.Equals(serviceName, StringComparison.OrdinalIgnoreCase)).ToArray();
|
||||
|
||||
var results = filtered.OrderDescending()
|
||||
.Skip(skip)
|
||||
.Take(total);
|
||||
return new ListResultReturn<ExtendedBackgroundService>(results.ToList(), filtered.Length);
|
||||
return _backgroundServices.ToList();
|
||||
}
|
||||
}
|
@@ -11,14 +11,20 @@ public class ClientService(IServiceScopeFactory scopeFactory, ILogger<ClientServ
|
||||
private readonly List<YouTubeClient> _clients = [];
|
||||
private CancellationToken _cancellationToken;
|
||||
private ILibraryService? _libraryService;
|
||||
|
||||
protected override async Task ExecuteServiceAsync(CancellationToken stoppingToken)
|
||||
|
||||
protected override async Task InitializeAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
_cancellationToken = stoppingToken;
|
||||
stoppingToken.Register(CancellationRequested);
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
_libraryService = scope.ServiceProvider.GetRequiredService<ILibraryService>();
|
||||
LogProgress("Initializing service...");
|
||||
Pause();
|
||||
}
|
||||
|
||||
protected override async Task ExecuteServiceAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void CancellationRequested()
|
||||
|
Reference in New Issue
Block a user