From 3e3c644cbbd01bf2c832c4eeadbab6015670b93d Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 11 Apr 2019 21:48:08 -0400 Subject: [PATCH] Fixed: ReleasePush Validation should use Protocol --- src/Lidarr.Api.V1/Indexers/ReleasePushModule.cs | 2 +- src/Lidarr.Api.V1/Indexers/ReleaseResource.cs | 5 +---- src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Lidarr.Api.V1/Indexers/ReleasePushModule.cs b/src/Lidarr.Api.V1/Indexers/ReleasePushModule.cs index c770cb8ed..9aecc9b3a 100644 --- a/src/Lidarr.Api.V1/Indexers/ReleasePushModule.cs +++ b/src/Lidarr.Api.V1/Indexers/ReleasePushModule.cs @@ -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(); } diff --git a/src/Lidarr.Api.V1/Indexers/ReleaseResource.cs b/src/Lidarr.Api.V1/Indexers/ReleaseResource.cs index 9620a929d..2855435ff 100644 --- a/src/Lidarr.Api.V1/Indexers/ReleaseResource.cs +++ b/src/Lidarr.Api.V1/Indexers/ReleaseResource.cs @@ -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; diff --git a/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs index 30d37f510..b1201c872 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs @@ -15,8 +15,9 @@ namespace NzbDrone.Integration.Test.ApiTests public void should_have_utc_date() { var body = new Dictionary(); - 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();