1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

New: Setting Pushbullet source device

This commit is contained in:
Ivan Brazza 2016-01-28 17:10:55 +00:00
parent 56da824e98
commit 9b0654c7f2
2 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,7 @@
using NLog;
using RestSharp;
using NzbDrone.Core.Rest;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.Notifications.PushBullet
{
@ -151,6 +152,11 @@ private void SendNotification(string title, string message, RestRequest request,
request.AddParameter("title", title);
request.AddParameter("body", message);
if (settings.SenderId.IsNotNullOrWhiteSpace())
{
request.AddParameter("source_device_iden", settings.SenderId);
}
client.Authenticator = new HttpBasicAuthenticator(settings.ApiKey, string.Empty);
client.ExecuteAndValidate(request);
}

View File

@ -33,6 +33,9 @@ public PushBulletSettings()
[FieldDefinition(2, Label = "Channel Tags", HelpText = "List of Channel Tags to send notifications to", Type = FieldType.Tag)]
public IEnumerable<string> ChannelTags { get; set; }
[FieldDefinition(3, Label = "Sender ID", HelpText = "The device ID to send notifications from, use device_iden in the device's URL on pushbullet.com (leave blank to send from yourself)")]
public string SenderId { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));