IMP: fixed slack notifications when post-processing, updated notifiers.py for slack to accomodate post-processing as well as snatches

This commit is contained in:
evilhero 2019-04-18 15:48:05 -04:00
parent 28c36d7e0e
commit 354c002fb2
2 changed files with 8 additions and 5 deletions

View File

@ -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")

View File

@ -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