You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/Readarr.Api.V1/Metadata/MetadataResource.cs

41 lines
978 B

using NzbDrone.Core.Extras.Metadata;
namespace Readarr.Api.V1.Metadata
{
public class MetadataResource : ProviderResource<MetadataResource>
{
public bool Enable { get; set; }
}
public class MetadataResourceMapper : ProviderResourceMapper<MetadataResource, MetadataDefinition>
{
public override MetadataResource ToResource(MetadataDefinition definition)
{
if (definition == null)
{
return null;
}
var resource = base.ToResource(definition);
resource.Enable = definition.Enable;
return resource;
}
public override MetadataDefinition ToModel(MetadataResource resource)
{
if (resource == null)
{
return null;
}
var definition = base.ToModel(resource);
definition.Enable = resource.Enable;
return definition;
}
}
}