diff --git a/couchpotato/core/notifications/base.py b/couchpotato/core/notifications/base.py index 7e98fa51..2604ef47 100644 --- a/couchpotato/core/notifications/base.py +++ b/couchpotato/core/notifications/base.py @@ -37,6 +37,9 @@ class Notification(Plugin): return notify + def getNotificationImage(self, size = 'small'): + return 'https://raw.github.com/RuudBurger/CouchPotatoServer/master/couchpotato/static/images/notify.couch.%s.png' % size + def notify(self, message = '', data = {}, listener = None): pass diff --git a/couchpotato/core/notifications/pushalot/main.py b/couchpotato/core/notifications/pushalot/main.py index 3b113311..1c82a25a 100644 --- a/couchpotato/core/notifications/pushalot/main.py +++ b/couchpotato/core/notifications/pushalot/main.py @@ -18,10 +18,10 @@ class Pushalot(Notification): 'AuthorizationToken': self.conf('auth_token'), 'Title': self.default_title, 'Body': toUnicode(message), - 'LinkTitle': toUnicode("CouchPotato"), - 'link': toUnicode("https://couchpota.to/"), 'IsImportant': self.conf('important'), 'IsSilent': self.conf('silent'), + 'Image': toUnicode(self.getNotificationImage('medium')), + 'Source': toUnicode(self.default_title) } headers = { diff --git a/couchpotato/core/notifications/xbmc/main.py b/couchpotato/core/notifications/xbmc/main.py index a1987bfa..0187a833 100755 --- a/couchpotato/core/notifications/xbmc/main.py +++ b/couchpotato/core/notifications/xbmc/main.py @@ -13,7 +13,6 @@ class XBMC(Notification): listen_to = ['renamer.after'] use_json_notifications = {} - couch_logo_url = 'https://raw.github.com/RuudBurger/CouchPotatoServer/master/couchpotato/static/images/xbmc-notify.png' def notify(self, message = '', data = {}, listener = None): if self.isDisabled(): return @@ -28,7 +27,7 @@ class XBMC(Notification): if self.use_json_notifications.get(host): response = self.request(host, [ - ('GUI.ShowNotification', {'title': self.default_title, 'message': message, 'image': self.couch_logo_url}), + ('GUI.ShowNotification', {'title': self.default_title, 'message': message, 'image': self.getNotificationImage('small')}), ('VideoLibrary.Scan', {}), ]) else: @@ -90,7 +89,7 @@ class XBMC(Notification): self.use_json_notifications[host] = True # send the text message - resp = self.request(host, [('GUI.ShowNotification', {'title':self.default_title, 'message':message, 'image':self.couch_logo_url})]) + resp = self.request(host, [('GUI.ShowNotification', {'title':self.default_title, 'message':message, 'image': self.getNotificationImage('small')})]) for result in resp: if (result.get('result') and result['result'] == 'OK'): log.debug('Message delivered successfully!') @@ -113,7 +112,7 @@ class XBMC(Notification): server = 'http://%s/xbmcCmds/' % host # Notification(title, message [, timeout , image]) - cmd = "xbmcHttp?command=ExecBuiltIn(Notification(%s,%s,'',%s))" % (urllib.quote(data['title']), urllib.quote(data['message']), urllib.quote(self.couch_logo_url)) + cmd = "xbmcHttp?command=ExecBuiltIn(Notification(%s,%s,'',%s))" % (urllib.quote(data['title']), urllib.quote(data['message']), urllib.quote(self.getNotificationImage('medium'))) server += cmd # I have no idea what to set to, just tried text/plain and seems to be working :) diff --git a/couchpotato/static/images/notify.couch.large.png b/couchpotato/static/images/notify.couch.large.png new file mode 100644 index 00000000..e64347bd Binary files /dev/null and b/couchpotato/static/images/notify.couch.large.png differ diff --git a/couchpotato/static/images/notify.couch.medium.png b/couchpotato/static/images/notify.couch.medium.png new file mode 100644 index 00000000..c02974de Binary files /dev/null and b/couchpotato/static/images/notify.couch.medium.png differ diff --git a/couchpotato/static/images/xbmc-notify.png b/couchpotato/static/images/notify.couch.small.png similarity index 100% rename from couchpotato/static/images/xbmc-notify.png rename to couchpotato/static/images/notify.couch.small.png