Ejemplo n.º 1
0
        private async Task Push(PushbulletNotificationSettings settings, string message, string title)
        {
            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, title, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        private async Task PushTestAsync(NotificationModel model, PushbulletNotificationSettings settings)
        {
            var message   = "This is just a test! Success!";
            var pushTitle = "Plex Requests: Test Message!";

            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, pushTitle, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        private async Task PushIssueAsync(NotificationModel model, PushbulletNotificationSettings settings)
        {
            var message   = $"A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";
            var pushTitle = $"Plex Requests: A new issue has been reported for {model.Title}";

            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, pushTitle, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }