private bool ValidateConfiguration(PushoverNotificationSettings settings) { if (!settings.Enabled) { return(false); } if (string.IsNullOrEmpty(settings.AccessToken) || string.IsNullOrEmpty(settings.UserToken)) { return(false); } return(true); }
private async Task Push(PushoverNotificationSettings settings, string message) { try { var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken); if (result?.status != 1) { Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed"); } } catch (Exception e) { Log.Error(e); } }
private async Task PushTestAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: Test Message!"; try { var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken); if (result?.status != 1) { Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed"); } } catch (Exception e) { Log.Error(e); } }
private async Task PushIssueAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}"; try { var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken); if (result?.status != 1) { Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed"); } } catch (Exception e) { Log.Error(e); } }
private async Task PushTestAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: Test Message!"; await Push(settings, message); }
private async Task PushIssueAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}"; await Push(settings, message); }
private async Task PushNewRequestAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: The {model.RequestType.GetString()?.ToLower()} '{model.Title}' has been requested by user: {model.User}"; await Push(settings, message); }
private async Task PushFaultQueue(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying"; await Push(settings, message); }
private async Task PushNewRequestAsync(NotificationModel model, PushoverNotificationSettings settings) { var message = $"Plex Requests: {model.Title} has been requested by user: {model.User}"; await Push(settings, message); }