mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 09:12:57 -07:00
#1588 When we make changes to any requests that we can trigger a notification, always send it to all notification agents, even if the user wont recieve it.
This commit is contained in:
parent
2ec87ac3d6
commit
9261232bab
9 changed files with 101 additions and 29 deletions
|
@ -183,6 +183,7 @@ namespace Ombi.Core.Engine
|
|||
await TvRepository.UpdateChild(request);
|
||||
if (request.Approved)
|
||||
{
|
||||
NotificationHelper.Notify(request, NotificationType.RequestApproved);
|
||||
await Audit.Record(AuditType.Approved, AuditArea.TvRequest, $"Approved Request {request.Title}", Username);
|
||||
// Autosend
|
||||
await TvSender.Send(request);
|
||||
|
@ -193,6 +194,21 @@ namespace Ombi.Core.Engine
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<ChildRequests> DenyChildRequest(ChildRequests request)
|
||||
{
|
||||
NotificationHelper.Notify(request, NotificationType.RequestDeclined);
|
||||
return await UpdateChildRequest(request);
|
||||
}
|
||||
|
||||
public async Task<ChildRequests> ChangeAvailability(ChildRequests request)
|
||||
{
|
||||
if (request.Available)
|
||||
{
|
||||
NotificationHelper.Notify(request, NotificationType.RequestAvailable);
|
||||
}
|
||||
return await UpdateChildRequest(request);
|
||||
}
|
||||
|
||||
public async Task<ChildRequests> UpdateChildRequest(ChildRequests request)
|
||||
{
|
||||
await Audit.Record(AuditType.Updated, AuditArea.TvRequest, $"Updated Request {request.Title}", Username);
|
||||
|
@ -289,6 +305,7 @@ namespace Ombi.Core.Engine
|
|||
if (model.Approved)
|
||||
{
|
||||
// Autosend
|
||||
NotificationHelper.Notify(model, NotificationType.RequestApproved);
|
||||
var result = await TvSender.Send(model);
|
||||
if (result.Success)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue