mirror of https://github.com/evilhero/mylar
Changed notification message(s) for PushOver
This commit is contained in:
parent
034c5fffa3
commit
cb7da2e6a3
|
@ -1937,9 +1937,7 @@ class PostProcessor(object):
|
||||||
|
|
||||||
if mylar.PUSHOVER_ENABLED:
|
if mylar.PUSHOVER_ENABLED:
|
||||||
pushover = notifiers.PUSHOVER()
|
pushover = notifiers.PUSHOVER()
|
||||||
title = prline + " complete!";
|
pushover.notify(prline, prline2, module=module)
|
||||||
message = "Mylar has downloaded and post-processed: " + prline;
|
|
||||||
pushover.notify(message, title, module=module)
|
|
||||||
|
|
||||||
if mylar.BOXCAR_ENABLED:
|
if mylar.BOXCAR_ENABLED:
|
||||||
boxcar = notifiers.BOXCAR()
|
boxcar = notifiers.BOXCAR()
|
||||||
|
|
|
@ -154,13 +154,18 @@ class PUSHOVER:
|
||||||
self._session = requests.Session()
|
self._session = requests.Session()
|
||||||
self._session.headers = {'Content-type': "application/x-www-form-urlencoded"}
|
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:
|
if not mylar.PUSHOVER_ENABLED:
|
||||||
return
|
return
|
||||||
if module is None:
|
if module is None:
|
||||||
module = ''
|
module = ''
|
||||||
module += '[NOTIFIER]'
|
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,
|
data = {'token': mylar.PUSHOVER_APIKEY,
|
||||||
'user': mylar.PUSHOVER_USERKEY,
|
'user': mylar.PUSHOVER_USERKEY,
|
||||||
'message': message.encode("utf-8"),
|
'message': message.encode("utf-8"),
|
||||||
|
|
|
@ -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)
|
nma.notify(snline=snline, snatched_nzb=nzbname, sent_to=sent_to, prov=nzbprov)
|
||||||
if mylar.PUSHOVER_ENABLED and mylar.PUSHOVER_ONSNATCH:
|
if mylar.PUSHOVER_ENABLED and mylar.PUSHOVER_ONSNATCH:
|
||||||
logger.info(u"Sending Pushover notification")
|
logger.info(u"Sending Pushover notification")
|
||||||
thisline = 'Mylar has snatched: ' + nzbname + ' from ' + nzbprov + ' and has sent it to ' + sent_to
|
|
||||||
pushover = notifiers.PUSHOVER()
|
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:
|
if mylar.BOXCAR_ENABLED and mylar.BOXCAR_ONSNATCH:
|
||||||
logger.info(u"Sending Boxcar notification")
|
logger.info(u"Sending Boxcar notification")
|
||||||
boxcar = notifiers.BOXCAR()
|
boxcar = notifiers.BOXCAR()
|
||||||
|
|
Loading…
Reference in New Issue