From 354c002fb24acd39f057e8d72d6ca496a15694c1 Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 18 Apr 2019 15:48:05 -0400 Subject: [PATCH] IMP: fixed slack notifications when post-processing, updated notifiers.py for slack to accomodate post-processing as well as snatches --- mylar/PostProcessor.py | 2 +- mylar/notifiers.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mylar/PostProcessor.py b/mylar/PostProcessor.py index 966dccd7..6ddbb5bf 100755 --- a/mylar/PostProcessor.py +++ b/mylar/PostProcessor.py @@ -2794,7 +2794,7 @@ class PostProcessor(object): if mylar.CONFIG.SLACK_ENABLED: slack = notifiers.SLACK() - slack.notify("Download and Postprocessing completed", prline, module=module) + slack.notify("Download and Postprocessing completed", prline2, module=module) if mylar.CONFIG.EMAIL_ENABLED and mylar.CONFIG.EMAIL_ONPOST: logger.info(u"Sending email notification") diff --git a/mylar/notifiers.py b/mylar/notifiers.py index 74f4a1f0..abb8699a 100644 --- a/mylar/notifiers.py +++ b/mylar/notifiers.py @@ -538,10 +538,13 @@ class SLACK: module = '' module += '[NOTIFIER]' - if all([sent_to is not None, prov is not None]): - attachment_text += ' %s from %s and %s' % (snatched_nzb, prov, sent_to) - elif sent_to is None: - attachment_text += ' %s from %s' % (snatched_nzb, prov) + if 'snatched' in attachment_text.lower(): + snatched_text = '%s: %s' % (attachment_text, snatched_nzb) + if all([sent_to is not None, prov is not None]): + snatched_text += ' from %s and %s' % (prov, sent_to) + elif sent_to is None: + snatched_text += ' from %s' % prov + attachment_text = snatched_text else: pass