Merge branch 'develop3' of https://github.com/mano3m/CouchPotatoServer into mano3m-develop3

This commit is contained in:
Ruud
2012-08-24 16:37:54 +02:00
4 changed files with 20 additions and 8 deletions
@@ -216,7 +216,7 @@ var NotificationBase = new Class({
},
testButtonName: function(fieldset){
var name = fieldset.getElement('h2').get('text');
var name = String(fieldset.getElement('h2').innerHTML).substring(0,String(fieldset.getElement('h2').innerHTML).indexOf("<span")); //.get('text');
return 'Test '+name;
}
+7 -2
View File
@@ -19,7 +19,7 @@ class NMJ(Notification):
def __init__(self):
addEvent('renamer.after', self.addToLibrary)
addApiView(self.testNotifyName(), self.test)
addApiView('notify.nmj.auto_config', self.autoConfig)
def autoConfig(self):
@@ -76,7 +76,7 @@ class NMJ(Notification):
mount = self.conf('mount')
database = self.conf('database')
if self.mount:
if mount:
log.debug('Try to mount network drive via url: %s', (mount))
try:
data = self.urlopen(mount)
@@ -114,3 +114,8 @@ class NMJ(Notification):
def failed(self):
return jsonified({'success': False})
def test(self):
return jsonified({'success': self.addToLibrary()})
@@ -26,8 +26,11 @@ class NotifyMyAndroid(Notification):
batch_mode = len(keys) > 1
)
successful = 0
for key in keys:
if not response[str(key)]['code'] == u'200':
log.error('Could not send notification to NotifyMyAndroid (%s). %s', (key, response[key]['message']))
else:
successful += 1
return response
return successful == len(keys)
+8 -4
View File
@@ -13,11 +13,15 @@ class XBMC(Notification):
def notify(self, message = '', data = {}, listener = None):
if self.isDisabled(): return
for host in [x.strip() for x in self.conf('host').split(",")]:
self.send({'command': 'ExecBuiltIn', 'parameter': 'Notification(CouchPotato, %s)' % message}, host)
self.send({'command': 'ExecBuiltIn', 'parameter': 'XBMC.updatelibrary(video)'}, host)
hosts = [x.strip() for x in self.conf('host').split(",")]
successful = 0
for host in hosts:
if self.send({'command': 'ExecBuiltIn', 'parameter': 'Notification(CouchPotato, %s)' % message}, host):
successful += 1
if self.send({'command': 'ExecBuiltIn', 'parameter': 'XBMC.updatelibrary(video)'}, host):
successful += 1
return True
return successful == len(hosts)*2
def send(self, command, host):