2016-12-23 21:45:24 +00:00
|
|
|
|
using NzbDrone.Core.Download;
|
2014-02-14 05:31:49 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.DownloadClient
|
|
|
|
|
{
|
|
|
|
|
public class DownloadClientModule : ProviderModuleBase<DownloadClientResource, IDownloadClient, DownloadClientDefinition>
|
|
|
|
|
{
|
|
|
|
|
public DownloadClientModule(IDownloadClientFactory downloadClientFactory)
|
|
|
|
|
: base(downloadClientFactory, "downloadclient")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-25 00:56:29 +00:00
|
|
|
|
protected override void MapToResource(DownloadClientResource resource, DownloadClientDefinition definition)
|
|
|
|
|
{
|
|
|
|
|
base.MapToResource(resource, definition);
|
|
|
|
|
|
|
|
|
|
resource.Enable = definition.Enable;
|
|
|
|
|
resource.Protocol = definition.Protocol;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void MapToModel(DownloadClientDefinition definition, DownloadClientResource resource)
|
|
|
|
|
{
|
|
|
|
|
base.MapToModel(definition, resource);
|
|
|
|
|
|
|
|
|
|
definition.Enable = resource.Enable;
|
|
|
|
|
definition.Protocol = resource.Protocol;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-17 23:43:33 +00:00
|
|
|
|
protected override void Validate(DownloadClientDefinition definition, bool includeWarnings)
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
|
|
|
|
if (!definition.Enable) return;
|
2015-02-17 23:43:33 +00:00
|
|
|
|
base.Validate(definition, includeWarnings);
|
2014-02-14 05:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|