|
|
@ -14,7 +14,7 @@ namespace Radarr.Api.V3
|
|
|
|
public abstract class ProviderModuleBase<TProviderResource, TProvider, TProviderDefinition> : RadarrRestModule<TProviderResource>
|
|
|
|
public abstract class ProviderModuleBase<TProviderResource, TProvider, TProviderDefinition> : RadarrRestModule<TProviderResource>
|
|
|
|
where TProviderDefinition : ProviderDefinition, new()
|
|
|
|
where TProviderDefinition : ProviderDefinition, new()
|
|
|
|
where TProvider : IProvider
|
|
|
|
where TProvider : IProvider
|
|
|
|
where TProviderResource : ProviderResource, new()
|
|
|
|
where TProviderResource : ProviderResource<TProviderResource>, new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly IProviderFactory<TProvider, TProviderDefinition> _providerFactory;
|
|
|
|
private readonly IProviderFactory<TProvider, TProviderDefinition> _providerFactory;
|
|
|
|
private readonly ProviderResourceMapper<TProviderResource, TProviderDefinition> _resourceMapper;
|
|
|
|
private readonly ProviderResourceMapper<TProviderResource, TProviderDefinition> _resourceMapper;
|
|
|
@ -124,12 +124,9 @@ namespace Radarr.Api.V3
|
|
|
|
var providerResource = _resourceMapper.ToResource(providerDefinition);
|
|
|
|
var providerResource = _resourceMapper.ToResource(providerDefinition);
|
|
|
|
var presetDefinitions = _providerFactory.GetPresetDefinitions(providerDefinition);
|
|
|
|
var presetDefinitions = _providerFactory.GetPresetDefinitions(providerDefinition);
|
|
|
|
|
|
|
|
|
|
|
|
providerResource.Presets = presetDefinitions.Select(v =>
|
|
|
|
providerResource.Presets = presetDefinitions
|
|
|
|
{
|
|
|
|
.Select(v => _resourceMapper.ToResource(v))
|
|
|
|
var presetResource = _resourceMapper.ToResource(v);
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
return presetResource as ProviderResource;
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Add(providerResource);
|
|
|
|
result.Add(providerResource);
|
|
|
|
}
|
|
|
|
}
|
|
|
|