Radarr/src/NzbDrone.Api/Metadata/MetadataModule.cs

37 lines
1.0 KiB
C#
Raw Normal View History

2016-12-23 21:45:24 +00:00
using NzbDrone.Core.Extras.Metadata;
2014-02-13 06:44:07 +00:00
namespace NzbDrone.Api.Metadata
{
public class MetadataModule : ProviderModuleBase<MetadataResource, IMetadata, MetadataDefinition>
{
public MetadataModule(IMetadataFactory metadataFactory)
: base(metadataFactory, "metadata")
{
}
protected override void MapToResource(MetadataResource resource, MetadataDefinition definition)
{
base.MapToResource(resource, definition);
resource.Enable = definition.Enable;
}
protected override void MapToModel(MetadataDefinition definition, MetadataResource resource)
{
base.MapToModel(definition, resource);
definition.Enable = resource.Enable;
}
protected override void Validate(MetadataDefinition definition, bool includeWarnings)
2014-02-13 06:44:07 +00:00
{
2019-12-22 22:08:53 +00:00
if (!definition.Enable)
{
return;
}
base.Validate(definition, includeWarnings);
2014-02-13 06:44:07 +00:00
}
}
2019-12-22 21:24:10 +00:00
}