Working search
This commit is contained in:
parent
271cf1f407
commit
2a572e8bc4
15 changed files with 217 additions and 39 deletions
|
|
@ -25,6 +25,24 @@ public class ClientService : IClientService
|
|||
return _clients;
|
||||
}
|
||||
|
||||
public async Task<JellyfinApiClient> GetClientForServerId(string serverId)
|
||||
{
|
||||
if (!_clients.Any())
|
||||
{
|
||||
await LoadClients();
|
||||
}
|
||||
|
||||
foreach (var client in _clients)
|
||||
{
|
||||
if (client.ID == serverId)
|
||||
{
|
||||
return client;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Client with ID {serverId} not found");
|
||||
}
|
||||
|
||||
private async Task LoadClients()
|
||||
{
|
||||
var servers = await _repository.GetServers();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue