From 76322c0145335f2e46575b543f1220e026ae6e1c Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 17 Sep 2014 21:50:41 +0200 Subject: [PATCH] Don't save data in notification --- couchpotato/core/notifications/core/main.py | 9 +++++++-- .../core/notifications/core/static/notification.js | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/notifications/core/main.py b/couchpotato/core/notifications/core/main.py index fdc837ad..c5f47933 100644 --- a/couchpotato/core/notifications/core/main.py +++ b/couchpotato/core/notifications/core/main.py @@ -155,9 +155,14 @@ class CoreNotifier(Notification): n = { '_t': 'notification', 'time': int(time.time()), - 'message': toUnicode(message), - 'data': data + 'message': toUnicode(message) } + + if data.get('sticky'): + n['sticky'] = True + if data.get('important'): + n['important'] = True + db.insert(n) self.frontend(type = listener, data = n) diff --git a/couchpotato/core/notifications/core/static/notification.js b/couchpotato/core/notifications/core/static/notification.js index 93bfa15d..b388b289 100644 --- a/couchpotato/core/notifications/core/static/notification.js +++ b/couchpotato/core/notifications/core/static/notification.js @@ -50,7 +50,7 @@ var NotificationBase = new Class({ , 'top'); self.notifications.include(result); - if((result.data.important !== undefined || result.data.sticky !== undefined) && !result.read){ + if((result.important !== undefined || result.sticky !== undefined) && !result.read){ var sticky = true; App.trigger('message', [result.message, sticky, result]) } @@ -72,7 +72,7 @@ var NotificationBase = new Class({ if(!force_ids) { var rn = self.notifications.filter(function(n){ - return !n.read && n.data.important === undefined + return !n.read && n.important === undefined }); var ids = [];