mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-24 06:55:21 -07:00
add logging of syno result #1671
This commit is contained in:
parent
b9435e85b1
commit
f0f64b052e
2 changed files with 17 additions and 10 deletions
|
@ -309,11 +309,11 @@ def main(args):
|
||||||
status_code=0,
|
status_code=0,
|
||||||
)
|
)
|
||||||
|
|
||||||
#try:
|
try:
|
||||||
input_directory, input_name, input_category, input_hash, input_id = core.parse_args(client_agent, args)
|
input_directory, input_name, input_category, input_hash, input_id = core.parse_args(client_agent, args)
|
||||||
#except Exception:
|
except Exception:
|
||||||
#logger.error('There was a problem loading variables')
|
logger.error('There was a problem loading variables')
|
||||||
#return -1
|
return -1
|
||||||
|
|
||||||
if input_directory and input_name and input_hash and input_id:
|
if input_directory and input_name and input_hash and input_id:
|
||||||
result = process_torrent(input_directory, input_name, input_category, input_hash, input_id, client_agent)
|
result = process_torrent(input_directory, input_name, input_category, input_hash, input_id, client_agent)
|
||||||
|
|
|
@ -8,6 +8,7 @@ from __future__ import (
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import core
|
import core
|
||||||
|
from core import logger
|
||||||
|
|
||||||
|
|
||||||
def parse_other(args):
|
def parse_other(args):
|
||||||
|
@ -89,7 +90,13 @@ def parse_synods(args):
|
||||||
input_hash = os.getenv('TR_TORRENT_HASH')
|
input_hash = os.getenv('TR_TORRENT_HASH')
|
||||||
input_id = os.getenv('TR_TORRENT_ID')
|
input_id = os.getenv('TR_TORRENT_ID')
|
||||||
res = core.TORRENT_CLASS.tasks_info(input_id, additional_param='detail')
|
res = core.TORRENT_CLASS.tasks_info(input_id, additional_param='detail')
|
||||||
input_directory = res['tasks'][0]['additional']['detail']['destination']
|
try:
|
||||||
|
input_directory = res['tasks'][0]['additional']['detail']['destination']
|
||||||
|
except:
|
||||||
|
logger.error('result keys are {0}'.format(res.keys()))
|
||||||
|
logger.info('result from syno {0}'.format(res))
|
||||||
|
input_directory = ''
|
||||||
|
|
||||||
return input_directory, input_name, input_category, input_hash, input_id
|
return input_directory, input_name, input_category, input_hash, input_id
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,7 +181,7 @@ def parse_args(client_agent, args):
|
||||||
'synods': parse_synods,
|
'synods': parse_synods,
|
||||||
}
|
}
|
||||||
|
|
||||||
#try:
|
try:
|
||||||
return clients[client_agent](args)
|
return clients[client_agent](args)
|
||||||
#except Exception:
|
except Exception:
|
||||||
# return None, None, None, None, None
|
return None, None, None, None, None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue