Fixed a bug where if you had auto approve it wouldn't notify you

pull/95/head
tidusjar 9 years ago
parent 8c2a3c8fd7
commit 78b429e666

@ -468,7 +468,7 @@ namespace PlexRequests.UI.Modules
Log.Info("Saved email settings, result: {0}", result);
return Response.AsJson(result
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Pushbullet Notifications!" }
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Pushover Notifications!" }
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
}

@ -234,6 +234,9 @@ namespace PlexRequests.UI.Modules
Log.Debug("Adding movie to database requests (No approval required)");
RequestService.AddRequest(model);
var notificationModel = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notificationModel);
return Response.AsJson(new JsonResponseModel { Result = true });
}
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to CouchPotato! Please check your settings." });
@ -339,6 +342,9 @@ namespace PlexRequests.UI.Modules
return Response.AsJson(new JsonResponseModel { Result = true });
}
var notify1 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notify1);
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to Sonarr! Please check your settings." });
}
@ -353,6 +359,9 @@ namespace PlexRequests.UI.Modules
Log.Debug("Adding tv to database requests (No approval required & SickRage)");
RequestService.AddRequest(model);
var notify2 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notify2);
return Response.AsJson(new JsonResponseModel { Result = true });
}
return Response.AsJson(new JsonResponseModel { Result = false, Message = result?.message != null ? "<b>Message From SickRage: </b>" + result.message : "Something went wrong adding the movie to SickRage! Please check your settings." });

Loading…
Cancel
Save