2016-12-23 21:45:24 +00:00
|
|
|
|
using NzbDrone.Core.Indexers;
|
2013-04-28 00:25:28 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Indexers
|
|
|
|
|
{
|
2013-10-12 18:44:40 +00:00
|
|
|
|
public class IndexerModule : ProviderModuleBase<IndexerResource, IIndexer, IndexerDefinition>
|
2013-04-28 00:25:28 +00:00
|
|
|
|
{
|
2013-09-24 23:42:55 +00:00
|
|
|
|
public IndexerModule(IndexerFactory indexerFactory)
|
2013-10-01 17:27:22 +00:00
|
|
|
|
: base(indexerFactory, "indexer")
|
2013-06-27 07:37:39 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2013-10-12 18:44:40 +00:00
|
|
|
|
|
2016-03-25 00:56:29 +00:00
|
|
|
|
protected override void MapToResource(IndexerResource resource, IndexerDefinition definition)
|
|
|
|
|
{
|
|
|
|
|
base.MapToResource(resource, definition);
|
|
|
|
|
|
|
|
|
|
resource.EnableRss = definition.EnableRss;
|
|
|
|
|
resource.EnableSearch = definition.EnableSearch;
|
|
|
|
|
resource.SupportsRss = definition.SupportsRss;
|
|
|
|
|
resource.SupportsSearch = definition.SupportsSearch;
|
|
|
|
|
resource.Protocol = definition.Protocol;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void MapToModel(IndexerDefinition definition, IndexerResource resource)
|
|
|
|
|
{
|
|
|
|
|
base.MapToModel(definition, resource);
|
|
|
|
|
|
|
|
|
|
definition.EnableRss = resource.EnableRss;
|
|
|
|
|
definition.EnableSearch = resource.EnableSearch;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-17 23:43:33 +00:00
|
|
|
|
protected override void Validate(IndexerDefinition definition, bool includeWarnings)
|
2013-10-12 18:44:40 +00:00
|
|
|
|
{
|
|
|
|
|
if (!definition.Enable) return;
|
2015-02-17 23:43:33 +00:00
|
|
|
|
base.Validate(definition, includeWarnings);
|
2013-10-12 18:44:40 +00:00
|
|
|
|
}
|
2013-04-28 00:25:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|