Skip to content

Commit

Permalink
Fix regression on mirrored notification title (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
elbowz committed Nov 15, 2014
1 parent 29465a1 commit e7981bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.8.18b
- Fix regression on mirrored notification title (https://github.com/elbowz/xbmc.service.pushbullet/issues/20)

0.8.16b
- Fix the number of caller, in android stock is in the notification title (https://github.com/elbowz/xbmc.service.pushbullet/issues/18)

Expand Down
15 changes: 13 additions & 2 deletions lib/push2Notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ def onMessage(self, message):

if message['type'] == 'mirror':
if 'icon' in message:
iconPath = common.base64ToFile(message['icon'], self.imgFilePath, imgFormat='JPEG', imgSize=(96, 96))

# BUILD KODI NOTIFICATION
applicationNameMirrored = message.get('application_name', '')
titleMirrored = message.get('title', '')

# Add Title...
title = applicationNameMirrored if not titleMirrored else applicationNameMirrored + ': '
title += titleMirrored

# ...Body...
body = message.get('body','').rstrip('\n').replace('\n', ' / ')

common.showNotification('%s: %s' % (message["application_name"], message['title']), body, self.notificationTime, iconPath)
# ...and Icon
iconPath = common.base64ToFile(message['icon'], self.imgFilePath, imgFormat='JPEG', imgSize=(96, 96))

common.showNotification(title, body, self.notificationTime, iconPath)

# kodi action (pause, stop, skip) on push dismiss (from devices)
elif message['type'] == 'dismissal':
Expand Down

0 comments on commit e7981bc

Please sign in to comment.