Fixed: ReleasePush Validation should use Protocol

pull/747/head
Qstick 5 years ago
parent d17e7cb13b
commit 3e3c644cbb

@ -35,7 +35,7 @@ namespace Lidarr.Api.V1.Indexers
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();
}

@ -51,9 +51,6 @@ namespace Lidarr.Api.V1.Indexers
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; }
// Sent when queuing an unknown release
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
@ -142,7 +139,7 @@ namespace Lidarr.Api.V1.Indexers
model.CommentUrl = resource.CommentUrl;
model.IndexerId = resource.IndexerId;
model.Indexer = resource.Indexer;
model.DownloadProtocol = resource.DownloadProtocol;
model.DownloadProtocol = resource.Protocol;
model.PublishDate = resource.PublishDate.ToUniversalTime();
return model;

@ -15,8 +15,9 @@ namespace NzbDrone.Integration.Test.ApiTests
public void should_have_utc_date()
{
var body = new Dictionary<string, object>();
body.Add("guid", "sdfsdfsdf");
body.Add("title", "The Artist - The Album (2008) [FLAC]");
body.Add("protocol", "Torrent");
body.Add("downloadUrl", "https://lidarr.audio/test.torrent");
body.Add("publishDate", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ", CultureInfo.InvariantCulture));
var request = ReleasePush.BuildRequest();

Loading…
Cancel
Save