parent
063dba22a8
commit
9f705e4161
|
@ -41,7 +41,8 @@ namespace Sonarr.Api.V3.Indexers
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
|
||||||
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
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.Protocol).NotEmpty();
|
||||||
PostValidator.RuleFor(s => s.PublishDate).NotEmpty();
|
PostValidator.RuleFor(s => s.PublishDate).NotEmpty();
|
||||||
}
|
}
|
||||||
|
@ -50,7 +51,7 @@ namespace Sonarr.Api.V3.Indexers
|
||||||
[Consumes("application/json")]
|
[Consumes("application/json")]
|
||||||
public ActionResult<List<ReleaseResource>> Create(ReleaseResource release)
|
public ActionResult<List<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);
|
ValidateResource(release);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue