mirror of
https://github.com/evilhero/mylar
synced 2025-03-12 15:02:55 +00:00
FIX:(#1637) Telegram notification on snatch would cause traceback error
This commit is contained in:
parent
1a71893e3e
commit
69e7fa7ef8
2 changed files with 10 additions and 16 deletions
|
@ -2247,16 +2247,16 @@ class PostProcessor(object):
|
|||
#update snatched table to change status to Downloaded
|
||||
if annchk == "no":
|
||||
updater.foundsearch(comicid, issueid, down=downtype, module=module, crc=crcvalue)
|
||||
dispiss = 'issue: %s' % issuenumOG
|
||||
dispiss = '#%s' % issuenumOG
|
||||
updatetable = 'issues'
|
||||
else:
|
||||
updater.foundsearch(comicid, issueid, mode='want_ann', down=downtype, module=module, crc=crcvalue)
|
||||
if 'annual' in issuenzb['ComicName'].lower(): #series.lower():
|
||||
dispiss = 'Annual issue: %s' % issuenumOG
|
||||
dispiss = 'Annual #%s' % issuenumOG
|
||||
elif 'special' in issuenzb['ComicName'].lower():
|
||||
dispiss = 'Special issue: %s' % issuenumOG
|
||||
dispiss = 'Special #%s' % issuenumOG
|
||||
else:
|
||||
dispiss = issuenumOG
|
||||
dispiss = '#%s' % issuenumOG
|
||||
updatetable = 'annuals'
|
||||
|
||||
#new method for updating status after pp
|
||||
|
@ -2391,16 +2391,10 @@ class PostProcessor(object):
|
|||
|
||||
def sendnotify(self, series, issueyear, issuenumOG, annchk, module):
|
||||
|
||||
if annchk == "no":
|
||||
if issueyear is None:
|
||||
prline = series + ' - issue #' + issuenumOG
|
||||
else:
|
||||
prline = series + ' (' + issueyear + ') - issue #' + issuenumOG
|
||||
if issueyear is None:
|
||||
prline = '%s %s' % (series, issuenumOG)
|
||||
else:
|
||||
if issueyear is None:
|
||||
prline = '%s - %s' %(series, issuenumOG)
|
||||
else:
|
||||
prline = '%s (%s) - %s' %(series, issueyear, issuenumOG)
|
||||
prline = '%s (%s) %s' % (series, issueyear, issuenumOG)
|
||||
|
||||
prline2 = 'Mylar has downloaded and post-processed: ' + prline
|
||||
|
||||
|
|
|
@ -2950,9 +2950,9 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
|
|||
def notify_snatch(nzbname, sent_to, modcomicname, comyear, IssueNumber, nzbprov):
|
||||
|
||||
if IssueNumber is not None:
|
||||
snline = modcomicname + ' (' + comyear + ') - Issue #' + IssueNumber + ' snatched!'
|
||||
snline = '%s (%s) #%s snatched!' % (modcomicname, comyear, IssueNumber)
|
||||
else:
|
||||
snline = modcomicname + ' (' + comyear + ') snatched!'
|
||||
snline = '%s (%s) snatched!' % (modcomicname, comyear)
|
||||
|
||||
if mylar.CONFIG.PROWL_ENABLED and mylar.CONFIG.PROWL_ONSNATCH:
|
||||
logger.info(u"Sending Prowl notification")
|
||||
|
@ -2977,7 +2977,7 @@ def notify_snatch(nzbname, sent_to, modcomicname, comyear, IssueNumber, nzbprov)
|
|||
if mylar.CONFIG.TELEGRAM_ENABLED and mylar.CONFIG.TELEGRAM_ONSNATCH:
|
||||
logger.info(u"Sending Telegram notification")
|
||||
telegram = notifiers.TELEGRAM()
|
||||
telegram.notify(snline, nzbname)
|
||||
telegram.notify(snline)
|
||||
if mylar.CONFIG.SLACK_ENABLED and mylar.CONFIG.SLACK_ONSNATCH:
|
||||
logger.info(u"Sending Slack notification")
|
||||
slack = notifiers.SLACK()
|
||||
|
|
Loading…
Add table
Reference in a new issue