1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Fixed: Use Protocol over DownloadProtocol for ReleasePushModule

DownloadProtocol is still supported for backwards compatibility
This commit is contained in:
Mark McDowall 2016-02-16 20:21:20 -08:00
parent 34d5fb1aa0
commit cb43888496
2 changed files with 21 additions and 3 deletions

View File

@ -30,7 +30,7 @@ public ReleasePushModule(IMakeDownloadDecision downloadDecisionMaker,
PostValidator.RuleFor(s => s.Title).NotEmpty();
PostValidator.RuleFor(s => s.DownloadUrl).NotEmpty();
PostValidator.RuleFor(s => s.DownloadProtocol).NotEmpty();
PostValidator.RuleFor(s => s.Protocol).NotEmpty();
PostValidator.RuleFor(s => s.PublishDate).NotEmpty();
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using NzbDrone.Api.REST;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Qualities;
@ -48,8 +49,25 @@ public class ReleaseResource : RestResource
public int? Leechers { get; set; }
public DownloadProtocol Protocol { get; set; }
//TODO: besides a test I don't think this is used...
public DownloadProtocol DownloadProtocol { get; set; }
// TODO: Remove in v3
// Used to support the original Release Push implementation
// JsonIgnore so we don't serialize it, but can still parse it
[JsonIgnore]
public DownloadProtocol DownloadProtocol
{
get
{
return Protocol;
}
set
{
if (value > 0 && Protocol == 0)
{
Protocol = value;
}
}
}
public bool IsDaily { get; set; }
public bool IsAbsoluteNumbering { get; set; }