mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-21 22:25:03 -04:00
New: Bump Version to V3 to please the masses
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Indexers;
|
||||
|
||||
namespace Radarr.Api.V3.DownloadClient
|
||||
{
|
||||
public class DownloadClientResource : ProviderResource
|
||||
{
|
||||
public bool Enable { get; set; }
|
||||
public DownloadProtocol Protocol { get; set; }
|
||||
public int Priority { get; set; }
|
||||
}
|
||||
|
||||
public class DownloadClientResourceMapper : ProviderResourceMapper<DownloadClientResource, DownloadClientDefinition>
|
||||
{
|
||||
public override DownloadClientResource ToResource(DownloadClientDefinition definition)
|
||||
{
|
||||
if (definition == null) return null;
|
||||
|
||||
var resource = base.ToResource(definition);
|
||||
|
||||
resource.Enable = definition.Enable;
|
||||
resource.Protocol = definition.Protocol;
|
||||
resource.Priority = definition.Priority;
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
public override DownloadClientDefinition ToModel(DownloadClientResource resource)
|
||||
{
|
||||
if (resource == null) return null;
|
||||
|
||||
var definition = base.ToModel(resource);
|
||||
|
||||
definition.Enable = resource.Enable;
|
||||
definition.Protocol = resource.Protocol;
|
||||
definition.Priority = resource.Priority;
|
||||
|
||||
return definition;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user