From a397a1903476ce2700315b4a466997f2bb1cbfc2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 13 Mar 2024 21:15:36 -0700 Subject: [PATCH] Fixed: Release push with only Magnet URL (cherry picked from commit 9f705e4161af3f4dd55b399d56b0b9c5a36e181b) --- src/Readarr.Api.V1/Indexers/ReleasePushController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Readarr.Api.V1/Indexers/ReleasePushController.cs b/src/Readarr.Api.V1/Indexers/ReleasePushController.cs index 34951ce98..759b9c2ab 100644 --- a/src/Readarr.Api.V1/Indexers/ReleasePushController.cs +++ b/src/Readarr.Api.V1/Indexers/ReleasePushController.cs @@ -38,7 +38,8 @@ namespace Readarr.Api.V1.Indexers _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(); } @@ -47,7 +48,7 @@ namespace Readarr.Api.V1.Indexers [Consumes("application/json")] public ActionResult 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);