Don't use 2 events after rename

This commit is contained in:
Ruud committed 2012-10-14 14:13:10 +02:00
1 parent 6106fd4e82
commit d3ebe531d5
10 files changed
+22 -26

No files matched your search

+3 -3
View File
@@ -14,7 +14,7 @@ class Notification(Plugin):
test_message = 'ZOMG Lazors Pewpewpew!'
listen_to = [
'movie.downloaded', 'movie.snatched',
'renamer.after', 'movie.snatched',
'updater.available', 'updater.updated',
]
dont_listen_to = []
@@ -30,10 +30,10 @@ class Notification(Plugin):
addEvent(listener, self.createNotifyHandler(listener))
def createNotifyHandler(self, listener):
def notify(message, data):
def notify(message = None, group = {}):
if not self.conf('on_snatch', default = True) and listener == 'movie.snatched':
return
return self.notify(message = message, data = data, listener = listener)
return self.notify(message = message, data = group, listener = listener)
return notify
+1 -1
View File
@@ -22,7 +22,7 @@ class CoreNotifier(Notification):
listeners = []
listen_to = [
'movie.downloaded', 'movie.snatched',
'renamer.after', 'movie.snatched',
'updater.available', 'updater.updated',
]
+4 -4
View File
@@ -69,7 +69,7 @@ class NMJ(Notification):
'mount': mount,
})
def addToLibrary(self, group = {}):
def addToLibrary(self, message = None, group = {}):
if self.isDisabled(): return
host = self.conf('host')
@@ -114,8 +114,8 @@ class NMJ(Notification):
def failed(self):
return jsonified({'success': False})
def test(self):
return jsonified({'success': self.addToLibrary()})
+1 -1
View File
@@ -17,7 +17,7 @@ class Plex(Notification):
super(Plex, self).__init__()
addEvent('renamer.after', self.addToLibrary)
def addToLibrary(self, group = {}):
def addToLibrary(self, message = None, group = {}):
if self.isDisabled(): return
log.info('Sending notification to Plex')
@@ -16,7 +16,7 @@ class Synoindex(Notification):
super(Synoindex, self).__init__()
addEvent('renamer.after', self.addToLibrary)
def addToLibrary(self, group = {}):
def addToLibrary(self, message = None, group = {}):
if self.isDisabled(): return
command = [self.index_path, '-A', group.get('destination_dir')]
+2 -2
View File
@@ -8,7 +8,7 @@ log = CPLog(__name__)
class XBMC(Notification):
listen_to = ['movie.downloaded']
listen_to = ['renamer.after']
def notify(self, message = '', data = {}, listener = None):
if self.isDisabled(): return
@@ -21,7 +21,7 @@ class XBMC(Notification):
if self.send({'command': 'ExecBuiltIn', 'parameter': 'XBMC.updatelibrary(video)'}, host):
successful += 1
return successful == len(hosts)*2
return successful == len(hosts) * 2
def send(self, command, host):