예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }