mirror of https://github.com/caronc/apprise
fixes icon display on kodi v6 and v2 protocol; refs #13
parent
11d9e0dc21
commit
ae2f11f27e
|
@ -61,6 +61,12 @@ class NotifyXBMC(NotifyBase):
|
||||||
else:
|
else:
|
||||||
self.schema = 'http'
|
self.schema = 'http'
|
||||||
|
|
||||||
|
# Prepare the default header
|
||||||
|
self.headers = {
|
||||||
|
'User-Agent': self.app_id,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
|
||||||
# Default protocol
|
# Default protocol
|
||||||
self.protocol = kwargs.get('protocol', self.xbmc_remote_protocol)
|
self.protocol = kwargs.get('protocol', self.xbmc_remote_protocol)
|
||||||
|
|
||||||
|
@ -71,11 +77,6 @@ class NotifyXBMC(NotifyBase):
|
||||||
Returns (headers, payload)
|
Returns (headers, payload)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
headers = {
|
|
||||||
'User-Agent': self.app_id,
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
|
|
||||||
# prepare JSON Object
|
# prepare JSON Object
|
||||||
payload = {
|
payload = {
|
||||||
'jsonrpc': '2.0',
|
'jsonrpc': '2.0',
|
||||||
|
@ -91,7 +92,7 @@ class NotifyXBMC(NotifyBase):
|
||||||
|
|
||||||
image_url = self.image_url(notify_type)
|
image_url = self.image_url(notify_type)
|
||||||
if image_url:
|
if image_url:
|
||||||
payload['image'] = image_url
|
payload['params']['image'] = image_url
|
||||||
if notify_type is NotifyType.FAILURE:
|
if notify_type is NotifyType.FAILURE:
|
||||||
payload['type'] = 'error'
|
payload['type'] = 'error'
|
||||||
|
|
||||||
|
@ -101,7 +102,7 @@ class NotifyXBMC(NotifyBase):
|
||||||
else:
|
else:
|
||||||
payload['type'] = 'info'
|
payload['type'] = 'info'
|
||||||
|
|
||||||
return (headers, dumps(payload))
|
return (self.headers, dumps(payload))
|
||||||
|
|
||||||
def _payload_20(self, title, body, notify_type, **kwargs):
|
def _payload_20(self, title, body, notify_type, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -110,11 +111,6 @@ class NotifyXBMC(NotifyBase):
|
||||||
Returns (headers, payload)
|
Returns (headers, payload)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
headers = {
|
|
||||||
'User-Agent': self.app_id,
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
|
|
||||||
# prepare JSON Object
|
# prepare JSON Object
|
||||||
payload = {
|
payload = {
|
||||||
'jsonrpc': '2.0',
|
'jsonrpc': '2.0',
|
||||||
|
@ -130,9 +126,9 @@ class NotifyXBMC(NotifyBase):
|
||||||
|
|
||||||
image_url = self.image_url(notify_type)
|
image_url = self.image_url(notify_type)
|
||||||
if image_url:
|
if image_url:
|
||||||
payload['image'] = image_url
|
payload['params']['image'] = image_url
|
||||||
|
|
||||||
return (headers, dumps(payload))
|
return (self.headers, dumps(payload))
|
||||||
|
|
||||||
def notify(self, title, body, notify_type, **kwargs):
|
def notify(self, title, body, notify_type, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue