From cdd681ad4899253378723c0f211e82d831af1c9f Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 11 Jan 2013 21:02:22 +0100 Subject: [PATCH] XBMC icon image --- couchpotato/core/notifications/xbmc/main.py | 9 +++++---- couchpotato/static/images/xbmc-notify.png | Bin 0 -> 1257 bytes 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 couchpotato/static/images/xbmc-notify.png diff --git a/couchpotato/core/notifications/xbmc/main.py b/couchpotato/core/notifications/xbmc/main.py index eef94695..a1987bfa 100755 --- a/couchpotato/core/notifications/xbmc/main.py +++ b/couchpotato/core/notifications/xbmc/main.py @@ -13,6 +13,7 @@ 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 @@ -27,7 +28,7 @@ class XBMC(Notification): if self.use_json_notifications.get(host): response = self.request(host, [ - ('GUI.ShowNotification', {'title':self.default_title, 'message':message}), + ('GUI.ShowNotification', {'title': self.default_title, 'message': message, 'image': self.couch_logo_url}), ('VideoLibrary.Scan', {}), ]) else: @@ -89,7 +90,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})]) + resp = self.request(host, [('GUI.ShowNotification', {'title':self.default_title, 'message':message, 'image':self.couch_logo_url})]) for result in resp: if (result.get('result') and result['result'] == 'OK'): log.debug('Message delivered successfully!') @@ -111,8 +112,8 @@ class XBMC(Notification): server = 'http://%s/xbmcCmds/' % host - # title, message [, timeout , image #can be added!] - cmd = "xbmcHttp?command=ExecBuiltIn(Notification('%s','%s'))" % (urllib.quote(data['title']), urllib.quote(data['message'])) + # 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)) 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/xbmc-notify.png b/couchpotato/static/images/xbmc-notify.png new file mode 100644 index 0000000000000000000000000000000000000000..6b7959f43fc2e7287a260e12282eec6910e04142 GIT binary patch literal 1257 zcmV=P)5000EANklS7SYc-@|LQ;gCmwp53^O5p>nCGp%n51m_P$>Ze!utB zV}F?a+2EtShmTx3(s|@EoJIf>#=oli)mgvlKMI$_KYN#Z&$N&4k;t@<=iu)S_S}@s zF#$}N-1>n%2mTAdCG<#SSZKs;u6o?M9H1jy-w~(67mLRh?*QnuBHw_VEu1mSU!dU= zHo5r|OrH@D^lWCn?2miYs;z4U!+0IwZ)`^!Gc!qAICSVWXYQqr z%SK;}M*dn=h1o*R-?nPyc{ljWsp^#*d&G2!qCpPk*ZBKV#wX|gIMW?`=u|!)A%F)$ zgxbNH4@_d@o}?!`oqRAoos}`n1ZRJK<@3+qYlZB6$c{^4@z4`*WdB)uC;ADyfx9@a z0{elxbFi`;x$n&^P>y3yEX5eABuVcl|db8PlXZ~N>soN z6T2hyfnCll07GXZ61ixootc1~CNKhrWlYP+9CTLTx%r%z|-zpOn_peZ>