mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Merge pull request #1483 from clinton-hall/fix/processresult
Add ProcessResult to auto_process.common
This commit is contained in:
commit
d196ec6f7d
1 changed files with 20 additions and 5 deletions
|
@ -29,7 +29,10 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
logger.error(
|
logger.error(
|
||||||
'The input directory:[{0}] is the Default Download Directory. Please configure category directories to prevent processing of other media.'.format(
|
'The input directory:[{0}] is the Default Download Directory. Please configure category directories to prevent processing of other media.'.format(
|
||||||
input_directory))
|
input_directory))
|
||||||
return [-1, '']
|
return ProcessResult(
|
||||||
|
message='',
|
||||||
|
status_code=-1,
|
||||||
|
)
|
||||||
|
|
||||||
if not download_id and client_agent == 'sabnzbd':
|
if not download_id and client_agent == 'sabnzbd':
|
||||||
download_id = get_nzoid(input_name)
|
download_id = get_nzoid(input_name)
|
||||||
|
@ -70,7 +73,10 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
logger.error(
|
logger.error(
|
||||||
'Category:[{0}] is not defined or is not enabled. Please rename it or ensure it is enabled for the appropriate section in your autoProcessMedia.cfg and try again.'.format(
|
'Category:[{0}] is not defined or is not enabled. Please rename it or ensure it is enabled for the appropriate section in your autoProcessMedia.cfg and try again.'.format(
|
||||||
input_category))
|
input_category))
|
||||||
return [-1, '']
|
return ProcessResult(
|
||||||
|
message='',
|
||||||
|
status_code=-1,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
usercat = 'ALL'
|
usercat = 'ALL'
|
||||||
|
|
||||||
|
@ -78,7 +84,10 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
logger.error(
|
logger.error(
|
||||||
'Category:[{0}] is not unique, {1} are using it. Please rename it or disable all other sections using the same category name in your autoProcessMedia.cfg and try again.'.format(
|
'Category:[{0}] is not unique, {1} are using it. Please rename it or disable all other sections using the same category name in your autoProcessMedia.cfg and try again.'.format(
|
||||||
input_category, section.keys()))
|
input_category, section.keys()))
|
||||||
return [-1, '']
|
return ProcessResult(
|
||||||
|
message='',
|
||||||
|
status_code=-1,
|
||||||
|
)
|
||||||
|
|
||||||
if section:
|
if section:
|
||||||
section_name = section.keys()[0]
|
section_name = section.keys()[0]
|
||||||
|
@ -86,7 +95,10 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
else:
|
else:
|
||||||
logger.error('Unable to locate a section with subsection:{0} enabled in your autoProcessMedia.cfg, exiting!'.format(
|
logger.error('Unable to locate a section with subsection:{0} enabled in your autoProcessMedia.cfg, exiting!'.format(
|
||||||
input_category))
|
input_category))
|
||||||
return [-1, '']
|
return ProcessResult(
|
||||||
|
status_code=-1,
|
||||||
|
message='',
|
||||||
|
)
|
||||||
|
|
||||||
cfg = dict(core.CFG[section_name][usercat])
|
cfg = dict(core.CFG[section_name][usercat])
|
||||||
|
|
||||||
|
@ -96,7 +108,10 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
if int(cfg.get('remote_path')) and not core.REMOTEPATHS:
|
if int(cfg.get('remote_path')) and not core.REMOTEPATHS:
|
||||||
logger.error('Remote Path is enabled for {0}:{1} but no Network mount points are defined. Please check your autoProcessMedia.cfg, exiting!'.format(
|
logger.error('Remote Path is enabled for {0}:{1} but no Network mount points are defined. Please check your autoProcessMedia.cfg, exiting!'.format(
|
||||||
section_name, input_category))
|
section_name, input_category))
|
||||||
return [-1, '']
|
return ProcessResult(
|
||||||
|
status_code=-1,
|
||||||
|
message='',
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error('Remote Path {0} is not valid for {1}:{2} Please set this to either 0 to disable or 1 to enable!'.format(
|
logger.error('Remote Path {0} is not valid for {1}:{2} Please set this to either 0 to disable or 1 to enable!'.format(
|
||||||
core.get('remote_path'), section_name, input_category))
|
core.get('remote_path'), section_name, input_category))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue