From 7fe9fa7e780d06d9bfc8697cf699aec6bb9cd4b2 Mon Sep 17 00:00:00 2001 From: evilhero Date: Fri, 16 Mar 2018 14:15:45 -0400 Subject: [PATCH] IMP: Added nzo_id reference to on-snatch call for sabnzbd snatches --- mylar/helpers.py | 2 ++ mylar/search.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/mylar/helpers.py b/mylar/helpers.py index 13d9e6a1..f00baa17 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -3036,6 +3036,8 @@ def script_env(mode, vars): os.environ['mylar_release_files'] = "|".join(json.dumps(vars['torrentinfo']['files'])) elif 'nzbinfo' in vars: os.environ['mylar_release_id'] = vars['nzbinfo']['id'] + if 'client_id' in vars['nzbinfo']: + os.environ['mylar_client_id'] = vars['nzbinfo']['client_id'] os.environ['mylar_release_nzbname'] = vars['nzbinfo']['nzbname'] os.environ['mylar_release_link'] = vars['nzbinfo']['link'] os.environ['mylar_release_nzbpath'] = vars['nzbinfo']['nzbpath'] diff --git a/mylar/search.py b/mylar/search.py index 2bdf4396..e7177902 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -2697,8 +2697,10 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc if mylar.CONFIG.ENABLE_SNATCH_SCRIPT: if mylar.USE_NZBGET: clientmode = 'nzbget' + client_id = None elif mylar.USE_SABNZBD: clientmode = 'sabnzbd' + client_id = sendtosab['nzo_id'] if comicinfo[0]['pack'] is False: pnumbers = None @@ -2708,6 +2710,7 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc plist= '|'.join(comicinfo[0]['pack_issuelist']) snatch_vars = {'nzbinfo': {'link': link, 'id': nzbid, + 'client_id': client_id, 'nzbname': nzbname, 'nzbpath': nzbpath}, 'comicinfo': {'comicname': comicinfo[0]['ComicName'],