From 3ad3bddd8313d607ee2a39a51a92e61a3673082c Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Wed, 8 Dec 2021 15:17:23 +0100 Subject: [PATCH] =?UTF-8?q?fix(notifications):=20=F0=9F=90=9B=20Do=20not?= =?UTF-8?q?=20notify=20user=20upon=20auto=20approval=20of=20a=20TV=20show?= =?UTF-8?q?=20(#4432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4431 --- src/Ombi.Core/Engine/TvRequestEngine.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index c05a23a48..edfa7b392 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -710,7 +710,11 @@ namespace Ombi.Core.Engine if (request.Approved) { - await NotificationHelper.Notify(request, NotificationType.RequestApproved); + var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification, string.Empty); + if (canNotify.Success) + { + await NotificationHelper.Notify(request, NotificationType.RequestApproved); + } // Autosend await TvSender.Send(request); } @@ -957,7 +961,11 @@ namespace Ombi.Core.Engine if (model.Approved) { // Autosend - await NotificationHelper.Notify(model, NotificationType.RequestApproved); + var canNotify = await RunSpecificRule(model, SpecificRules.CanSendNotification, string.Empty); + if (canNotify.Success) + { + await NotificationHelper.Notify(model, NotificationType.RequestApproved); + } var result = await TvSender.Send(model); if (result.Success) {