1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

New: Bump Version to V3 to please the masses

This commit is contained in:
Qstick
2019-12-02 20:36:18 -05:00
parent 29011cac5e
commit 0aa8ac5d39
149 changed files with 212 additions and 214 deletions
@@ -0,0 +1,46 @@
using NzbDrone.Core.Indexers;
namespace Radarr.Api.V3.Indexers
{
public class IndexerResource : ProviderResource
{
public bool EnableRss { get; set; }
public bool EnableAutomaticSearch { get; set; }
public bool EnableInteractiveSearch { get; set; }
public bool SupportsRss { get; set; }
public bool SupportsSearch { get; set; }
public DownloadProtocol Protocol { get; set; }
}
public class IndexerResourceMapper : ProviderResourceMapper<IndexerResource, IndexerDefinition>
{
public override IndexerResource ToResource(IndexerDefinition definition)
{
if (definition == null) return null;
var resource = base.ToResource(definition);
resource.EnableRss = definition.EnableRss;
resource.EnableAutomaticSearch = definition.EnableAutomaticSearch;
resource.EnableInteractiveSearch = definition.EnableInteractiveSearch;
resource.SupportsRss = definition.SupportsRss;
resource.SupportsSearch = definition.SupportsSearch;
resource.Protocol = definition.Protocol;
return resource;
}
public override IndexerDefinition ToModel(IndexerResource resource)
{
if (resource == null) return null;
var definition = base.ToModel(resource);
definition.EnableRss = resource.EnableRss;
definition.EnableAutomaticSearch = resource.EnableAutomaticSearch;
definition.EnableInteractiveSearch = resource.EnableInteractiveSearch;
return definition;
}
}
}