mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-01-02 02:47:52 -05:00
31 lines
946 B
C#
31 lines
946 B
C#
using Cleanuparr.Domain.Enums;
|
|
using Cleanuparr.Infrastructure.Features.Arr.Interfaces;
|
|
|
|
namespace Cleanuparr.Infrastructure.Features.Arr;
|
|
|
|
public sealed class ArrClientFactory
|
|
{
|
|
private readonly ISonarrClient _sonarrClient;
|
|
private readonly IRadarrClient _radarrClient;
|
|
private readonly ILidarrClient _lidarrClient;
|
|
|
|
public ArrClientFactory(
|
|
SonarrClient sonarrClient,
|
|
RadarrClient radarrClient,
|
|
LidarrClient lidarrClient
|
|
)
|
|
{
|
|
_sonarrClient = sonarrClient;
|
|
_radarrClient = radarrClient;
|
|
_lidarrClient = lidarrClient;
|
|
}
|
|
|
|
public IArrClient GetClient(InstanceType type) =>
|
|
type switch
|
|
{
|
|
InstanceType.Sonarr => _sonarrClient,
|
|
InstanceType.Radarr => _radarrClient,
|
|
InstanceType.Lidarr => _lidarrClient,
|
|
_ => throw new NotImplementedException($"instance type {type} is not yet supported")
|
|
};
|
|
} |