mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 01:02:59 -07:00
Fix Pushy device token and add logging
This commit is contained in:
parent
bc5ce52236
commit
c405f04e9c
1 changed files with 4 additions and 2 deletions
|
@ -678,6 +678,7 @@ class ANDROIDAPP(Notifier):
|
|||
'body': body.encode("utf-8")}
|
||||
}
|
||||
|
||||
logger.debug(u"PlexPy Notifiers :: Pushy request body: %s" % json.dumps(data))
|
||||
http_handler = HTTPSConnection("api.pushy.me")
|
||||
http_handler.request("POST",
|
||||
"/push?%s" % urlencode({'api_key': self.config['api_key']}),
|
||||
|
@ -685,6 +686,7 @@ class ANDROIDAPP(Notifier):
|
|||
body=json.dumps(data))
|
||||
response = http_handler.getresponse()
|
||||
request_status = response.status
|
||||
logger.debug(u"PlexPy Notifiers :: Pushy response: %s" % response.read())
|
||||
|
||||
if request_status == 200:
|
||||
logger.info(u"PlexPy Notifiers :: Android app notification sent.")
|
||||
|
@ -709,9 +711,9 @@ class ANDROIDAPP(Notifier):
|
|||
devices = {}
|
||||
for device in result:
|
||||
if device['friendly_name']:
|
||||
devices['device_token'] = device['friendly_name']
|
||||
devices[device['device_token']] = device['friendly_name']
|
||||
else:
|
||||
devices['device_token'] = device['device_name']
|
||||
devices[device['device_token']] = device['device_name']
|
||||
|
||||
return devices
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue