mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 16:22:55 -07:00
Fixed #1712
This commit is contained in:
parent
9a8bd096b5
commit
ab42723dc9
2 changed files with 21 additions and 1 deletions
|
@ -193,7 +193,11 @@ namespace Ombi.Core.Engine
|
|||
request.Denied = false;
|
||||
await MovieRepository.Update(request);
|
||||
|
||||
var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification);
|
||||
if (canNotify.Success)
|
||||
{
|
||||
NotificationHelper.Notify(request, NotificationType.RequestApproved);
|
||||
}
|
||||
|
||||
if (request.Approved)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using Ombi.Core.Rule.Interfaces;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Store.Entities.Requests;
|
||||
|
||||
namespace Ombi.Core.Rule.Rules.Specific
|
||||
|
@ -21,8 +22,23 @@ namespace Ombi.Core.Rule.Rules.Specific
|
|||
var req = (BaseRequest)obj;
|
||||
var sendNotification = !req.Approved; /*|| !prSettings.IgnoreNotifyForAutoApprovedRequests;*/
|
||||
|
||||
if (req.RequestType == RequestType.Movie)
|
||||
{
|
||||
sendNotification = !User.IsInRole(OmbiRoles.AutoApproveMovie);
|
||||
}
|
||||
else if(req.RequestType == RequestType.TvShow)
|
||||
{
|
||||
sendNotification = !User.IsInRole(OmbiRoles.AutoApproveTv);
|
||||
}
|
||||
|
||||
|
||||
if (User.IsInRole(OmbiRoles.Admin))
|
||||
{
|
||||
sendNotification = false; // Don't bother sending a notification if the user is an admin
|
||||
}
|
||||
|
||||
|
||||
|
||||
return Task.FromResult(new RuleResult
|
||||
{
|
||||
Success = sendNotification
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue