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