diff --git a/plexpy/config.py b/plexpy/config.py index 094ca9cf..78ffd5d7 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -222,6 +222,7 @@ _CONFIG_DEFINITIONS = { 'JOIN_APIKEY': (str, 'Join', ''), 'JOIN_DEVICEID': (str, 'Join', ''), 'JOIN_ENABLED': (int, 'Join', 0), + 'JOIN_INCL_SUBJECT': (int, 'Join', 1), 'JOIN_ON_PLAY': (int, 'Join', 0), 'JOIN_ON_STOP': (int, 'Join', 0), 'JOIN_ON_PAUSE': (int, 'Join', 0), diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 28c5cbaa..fffdbcec 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2555,6 +2555,7 @@ class JOIN(object): def __init__(self): self.apikey = plexpy.CONFIG.JOIN_APIKEY self.deviceid = plexpy.CONFIG.JOIN_DEVICEID + self.incl_subject = plexpy.CONFIG.JOIN_INCL_SUBJECT def conf(self, options): return cherrypy.config['config'].get('PUSHBULLET', options) @@ -2567,9 +2568,11 @@ class JOIN(object): data = {'apikey': self.apikey, deviceid_key: self.deviceid, - 'title': subject.encode("utf-8"), 'text': message.encode("utf-8")} + if self.incl_subject: + data['title'] = subject.encode("utf-8") + response = requests.post('https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush', params=data) request_status = response.status_code @@ -2650,6 +2653,12 @@ class JOIN(object): {'label': 'Your Devices IDs', 'description': devices, 'input_type': 'help' + }, + {'label': 'Include Subject Line', + 'value': self.incl_subject, + 'name': 'join_incl_subject', + 'description': 'Include the subject line with the notifications.', + 'input_type': 'checkbox' } ]