diff --git a/mylar/PostProcessor.py b/mylar/PostProcessor.py index 0964fe74..807e6746 100755 --- a/mylar/PostProcessor.py +++ b/mylar/PostProcessor.py @@ -1937,9 +1937,7 @@ class PostProcessor(object): if mylar.PUSHOVER_ENABLED: pushover = notifiers.PUSHOVER() - title = prline + " complete!"; - message = "Mylar has downloaded and post-processed: " + prline; - pushover.notify(message, title, module=module) + pushover.notify(prline, prline2, module=module) if mylar.BOXCAR_ENABLED: boxcar = notifiers.BOXCAR() diff --git a/mylar/notifiers.py b/mylar/notifiers.py index dd235cd1..d6783d2d 100644 --- a/mylar/notifiers.py +++ b/mylar/notifiers.py @@ -154,13 +154,18 @@ class PUSHOVER: self._session = requests.Session() self._session.headers = {'Content-type': "application/x-www-form-urlencoded"} - def notify(self, message, event, module=None): + def notify(self, event, message=None, snatched_nzb=None, prov=None, sent_to=None, module=None): if not mylar.PUSHOVER_ENABLED: return if module is None: module = '' module += '[NOTIFIER]' + if snatched_nzb: + if snatched_nzb[-1] == '\.': + snatched_nzb = snatched_nzb[:-1] + message = "Mylar has snatched: " + snatched_nzb + " from " + prov + " and has sent it to " + sent_to + data = {'token': mylar.PUSHOVER_APIKEY, 'user': mylar.PUSHOVER_USERKEY, 'message': message.encode("utf-8"), diff --git a/mylar/search.py b/mylar/search.py index 4101ccf6..c8270e10 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -2371,9 +2371,8 @@ def notify_snatch(nzbname, sent_to, modcomicname, comyear, IssueNumber, nzbprov) nma.notify(snline=snline, snatched_nzb=nzbname, sent_to=sent_to, prov=nzbprov) if mylar.PUSHOVER_ENABLED and mylar.PUSHOVER_ONSNATCH: logger.info(u"Sending Pushover notification") - thisline = 'Mylar has snatched: ' + nzbname + ' from ' + nzbprov + ' and has sent it to ' + sent_to pushover = notifiers.PUSHOVER() - pushover.notify(thisline, snline) + pushover.notify(snline, snatched_nzb=nzbname, sent_to=sent_to, prov=nzbprov) if mylar.BOXCAR_ENABLED and mylar.BOXCAR_ONSNATCH: logger.info(u"Sending Boxcar notification") boxcar = notifiers.BOXCAR()