1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Add base for netimport api. Still nothing on the UI side.

This commit is contained in:
Leonardo Galli
2017-01-21 21:09:02 +01:00
parent 4f37a36619
commit 2c52795822
3 changed files with 112 additions and 0 deletions
@@ -0,0 +1,32 @@
using NzbDrone.Core.NetImport;
namespace NzbDrone.Api.NetImport
{
public class NetImportModule : ProviderModuleBase<NetImportResource, INetImport, NetImportDefinition>
{
public NetImportModule(NetImportFactory indexerFactory)
: base(indexerFactory, "indexer")
{
}
protected override void MapToResource(NetImportResource resource, NetImportDefinition definition)
{
base.MapToResource(resource, definition);
resource.Enabled = definition.Enabled;
}
protected override void MapToModel(NetImportDefinition definition, NetImportResource resource)
{
base.MapToModel(definition, resource);
resource.Enabled = definition.Enabled;
}
protected override void Validate(NetImportDefinition definition, bool includeWarnings)
{
if (!definition.Enable) return;
base.Validate(definition, includeWarnings);
}
}
}