Join notification subject line optional
This commit is contained in:
@@ -222,6 +222,7 @@ _CONFIG_DEFINITIONS = {
|
|||||||
'JOIN_APIKEY': (str, 'Join', ''),
|
'JOIN_APIKEY': (str, 'Join', ''),
|
||||||
'JOIN_DEVICEID': (str, 'Join', ''),
|
'JOIN_DEVICEID': (str, 'Join', ''),
|
||||||
'JOIN_ENABLED': (int, 'Join', 0),
|
'JOIN_ENABLED': (int, 'Join', 0),
|
||||||
|
'JOIN_INCL_SUBJECT': (int, 'Join', 1),
|
||||||
'JOIN_ON_PLAY': (int, 'Join', 0),
|
'JOIN_ON_PLAY': (int, 'Join', 0),
|
||||||
'JOIN_ON_STOP': (int, 'Join', 0),
|
'JOIN_ON_STOP': (int, 'Join', 0),
|
||||||
'JOIN_ON_PAUSE': (int, 'Join', 0),
|
'JOIN_ON_PAUSE': (int, 'Join', 0),
|
||||||
|
@@ -2555,6 +2555,7 @@ class JOIN(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.apikey = plexpy.CONFIG.JOIN_APIKEY
|
self.apikey = plexpy.CONFIG.JOIN_APIKEY
|
||||||
self.deviceid = plexpy.CONFIG.JOIN_DEVICEID
|
self.deviceid = plexpy.CONFIG.JOIN_DEVICEID
|
||||||
|
self.incl_subject = plexpy.CONFIG.JOIN_INCL_SUBJECT
|
||||||
|
|
||||||
def conf(self, options):
|
def conf(self, options):
|
||||||
return cherrypy.config['config'].get('PUSHBULLET', options)
|
return cherrypy.config['config'].get('PUSHBULLET', options)
|
||||||
@@ -2567,9 +2568,11 @@ class JOIN(object):
|
|||||||
|
|
||||||
data = {'apikey': self.apikey,
|
data = {'apikey': self.apikey,
|
||||||
deviceid_key: self.deviceid,
|
deviceid_key: self.deviceid,
|
||||||
'title': subject.encode("utf-8"),
|
|
||||||
'text': message.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',
|
response = requests.post('https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush',
|
||||||
params=data)
|
params=data)
|
||||||
request_status = response.status_code
|
request_status = response.status_code
|
||||||
@@ -2650,6 +2653,12 @@ class JOIN(object):
|
|||||||
{'label': 'Your Devices IDs',
|
{'label': 'Your Devices IDs',
|
||||||
'description': devices,
|
'description': devices,
|
||||||
'input_type': 'help'
|
'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'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user