More nosql

This commit is contained in:
Ruud committed 2014-02-02 20:41:14 +01:00
1 parent 63743dd2b6
commit 99252074be
82 files changed
+643 -715

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ import time"""
return key
def make_key_value(self, data):
if data.get('type') == 'notification':
if data.get('_t') == 'notification':
added = data.get('added', time.time())
data['added'] = added
@@ -35,7 +35,7 @@ import time"""
return key
def make_key_value(self, data):
if data.get('type') == 'notification' and not data.get('read'):
if data.get('_t') == 'notification' and not data.get('read'):
added = data.get('added', time.time())
data['added'] = added
+3 -3
View File
@@ -57,8 +57,8 @@ class CoreNotifier(Notification):
fireEvent('schedule.interval', 'core.check_messages', self.checkMessages, hours = 12, single = True)
fireEvent('schedule.interval', 'core.clean_messages', self.cleanMessages, seconds = 15, single = True)
addEvent('app.load2', self.clean)
addEvent('app.load2', self.checkMessages)
addEvent('app.load', self.clean)
addEvent('app.load', self.checkMessages)
addEvent('database.setup', self.databaseSetup)
@@ -161,7 +161,7 @@ class CoreNotifier(Notification):
data['notification_type'] = listener if listener else 'unknown'
n = {
'type': 'notification',
'_t': 'notification',
'time': int(time.time()),
'message': toUnicode(message),
'data': data
+1 -1
View File
@@ -16,7 +16,7 @@ class Growl(Notification):
super(Growl, self).__init__()
if self.isEnabled():
addEvent('app.load2', self.register)
addEvent('app.load', self.register)
def register(self):
if self.registered: return
@@ -23,16 +23,16 @@ class Pushover(Notification):
'priority': self.conf('priority'),
}
if data and data.get('library'):
if data and data.get('identifier'):
api_data.update({
'url': toUnicode('http://www.imdb.com/title/%s/' % data['library']['identifier']),
'url_title': toUnicode('%s on IMDb' % getTitle(data['library'])),
'url': toUnicode('http://www.imdb.com/title/%s/' % data['identifier']),
'url_title': toUnicode('%s on IMDb' % getTitle(data)),
})
http_handler.request('POST',
"/1/messages.json",
headers = {'Content-type': 'application/x-www-form-urlencoded'},
body = tryUrlencode(api_data)
"/1/messages.json",
headers = {'Content-type': 'application/x-www-form-urlencoded'},
body = tryUrlencode(api_data)
)
response = http_handler.getresponse()
+4 -3
View File
@@ -1,3 +1,4 @@
from couchpotato.core.helpers.variable import getTitle
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
@@ -21,9 +22,9 @@ class Trakt(Notification):
'username': self.conf('automation_username'),
'password' : self.conf('automation_password'),
'movies': [{
'imdb_id': data['library']['identifier'],
'title': data['library']['titles'][0]['title'],
'year': data['library']['year']
'imdb_id': data['identifier'],
'title': getTitle(data),
'year': data['info']['year']
}] if data else []
}
+2 -2
View File
@@ -1,4 +1,4 @@
from couchpotato.core.helpers.variable import splitString
from couchpotato.core.helpers.variable import splitString, getTitle
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import base64
@@ -131,7 +131,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.getNotificationImage('medium')))
cmd = "xbmcHttp?command=ExecBuiltIn(Notification(%s,%s,'',%s))" % (urllib.quote(getTitle(data)), 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 :)