From 5dd802bc31fdbbc8b4325a0f94e9b843d5f5f2fc Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 3 Aug 2011 22:00:42 +0200 Subject: [PATCH] Loop over disabled events, for single returns --- couchpotato/core/event.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index 231c17e..829d664 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -44,10 +44,17 @@ def fireEvent(name, *args, **kwargs): if single and not merge: results = None - if result[0][0] is True and result[0][1] is not None: - results = result[0][1] - elif result[0][1]: - errorHandler(result[0][1]) + + # Loop over results, stop when first not None result is found. + for r in result: + if r[0] is True and r[1] is not None: + results = r[1] + break + elif r[1]: + errorHandler(r[1]) + else: + log.debug('Assume disabled plugin: %s' % r[2]) + else: results = [] for r in result: