Fixed the issue where we mark as unavailable and a declined notification gets triggered #1371

This commit is contained in:
Jamie.Rees 2017-04-12 08:24:52 +01:00
parent 213e54e02d
commit deb5878405

View file

@ -526,18 +526,21 @@ namespace Ombi.UI.Modules
var result = await Service.UpdateRequestAsync(originalRequest); var result = await Service.UpdateRequestAsync(originalRequest);
var plexSettings = await PlexSettings.GetSettingsAsync(); var plexSettings = await PlexSettings.GetSettingsAsync();
if (plexSettings.Enable) if (available)
{ {
await if (plexSettings.Enable)
PlexNotificationEngine.NotifyUsers(originalRequest, {
available ? NotificationType.RequestAvailable : NotificationType.RequestDeclined); await
} PlexNotificationEngine.NotifyUsers(originalRequest,
NotificationType.RequestAvailable);
}
var embySettings = await EmbySettings.GetSettingsAsync(); var embySettings = await EmbySettings.GetSettingsAsync();
if (embySettings.Enable) if (embySettings.Enable)
{ {
await EmbyNotificationEngine.NotifyUsers(originalRequest, await EmbyNotificationEngine.NotifyUsers(originalRequest,
available ? NotificationType.RequestAvailable : NotificationType.RequestDeclined); NotificationType.RequestAvailable);
}
} }
return Response.AsJson(result return Response.AsJson(result
? new { Result = true, Available = available, Message = string.Empty } ? new { Result = true, Available = available, Message = string.Empty }