mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-27 00:02:25 +00:00
Fixed: ReleasePush Validation should use Protocol
This commit is contained in:
parent
d17e7cb13b
commit
3e3c644cbb
3 changed files with 4 additions and 6 deletions
|
@ -35,7 +35,7 @@ public ReleasePushModule(IMakeDownloadDecision downloadDecisionMaker,
|
||||||
|
|
||||||
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
||||||
PostValidator.RuleFor(s => s.DownloadUrl).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();
|
PostValidator.RuleFor(s => s.PublishDate).NotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,6 @@ public class ReleaseResource : RestResource
|
||||||
public int? Leechers { get; set; }
|
public int? Leechers { get; set; }
|
||||||
public DownloadProtocol Protocol { 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
|
// Sent when queuing an unknown release
|
||||||
|
|
||||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
@ -142,7 +139,7 @@ public static ReleaseInfo ToModel(this ReleaseResource resource)
|
||||||
model.CommentUrl = resource.CommentUrl;
|
model.CommentUrl = resource.CommentUrl;
|
||||||
model.IndexerId = resource.IndexerId;
|
model.IndexerId = resource.IndexerId;
|
||||||
model.Indexer = resource.Indexer;
|
model.Indexer = resource.Indexer;
|
||||||
model.DownloadProtocol = resource.DownloadProtocol;
|
model.DownloadProtocol = resource.Protocol;
|
||||||
model.PublishDate = resource.PublishDate.ToUniversalTime();
|
model.PublishDate = resource.PublishDate.ToUniversalTime();
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
|
|
|
@ -15,8 +15,9 @@ public class ReleasePushFixture : IntegrationTest
|
||||||
public void should_have_utc_date()
|
public void should_have_utc_date()
|
||||||
{
|
{
|
||||||
var body = new Dictionary<string, object>();
|
var body = new Dictionary<string, object>();
|
||||||
body.Add("guid", "sdfsdfsdf");
|
|
||||||
body.Add("title", "The Artist - The Album (2008) [FLAC]");
|
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));
|
body.Add("publishDate", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ", CultureInfo.InvariantCulture));
|
||||||
|
|
||||||
var request = ReleasePush.BuildRequest();
|
var request = ReleasePush.BuildRequest();
|
||||||
|
|
Loading…
Reference in a new issue