mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-22 07:42:28 +00:00
Fixed: Release push with only Magnet URL
(cherry picked from commit 9f705e4161af3f4dd55b399d56b0b9c5a36e181b)
This commit is contained in:
parent
1db0eb1029
commit
ebfa68087d
1 changed files with 3 additions and 2 deletions
|
@ -41,7 +41,8 @@ public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
|||
_logger = logger;
|
||||
|
||||
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
||||
PostValidator.RuleFor(s => s.DownloadUrl).NotEmpty();
|
||||
PostValidator.RuleFor(s => s.DownloadUrl).NotEmpty().When(s => s.MagnetUrl.IsNullOrWhiteSpace());
|
||||
PostValidator.RuleFor(s => s.MagnetUrl).NotEmpty().When(s => s.DownloadUrl.IsNullOrWhiteSpace());
|
||||
PostValidator.RuleFor(s => s.Protocol).NotEmpty();
|
||||
PostValidator.RuleFor(s => s.PublishDate).NotEmpty();
|
||||
}
|
||||
|
@ -50,7 +51,7 @@ public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
|||
[Consumes("application/json")]
|
||||
public ActionResult<ReleaseResource> Create(ReleaseResource release)
|
||||
{
|
||||
_logger.Info("Release pushed: {0} - {1}", release.Title, release.DownloadUrl);
|
||||
_logger.Info("Release pushed: {0} - {1}", release.Title, release.DownloadUrl ?? release.MagnetUrl);
|
||||
|
||||
ValidateResource(release);
|
||||
|
||||
|
|
Loading…
Reference in a new issue