Fixes for user_script categories. #1643

This commit is contained in:
Clinton Hall 2019-08-02 09:37:02 +12:00 committed by GitHub
commit 0e23991724
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,16 +76,19 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
# auto-detect section # auto-detect section
section = core.CFG.findsection(input_category).isenabled() section = core.CFG.findsection(input_category).isenabled()
if section is None: if section is None: #Check for user_scripts for 'ALL' and 'UNCAT'
section = core.CFG.findsection('ALL').isenabled() if usercat in core.CATEGORIES:
if section is None: section = core.CFG.findsection('ALL').isenabled()
logger.error('Category:[{0}] is not defined or is not enabled. ' usercat = 'ALL'
'Please rename it or ensure it is enabled for the appropriate section '
'in your autoProcessMedia.cfg and try again.'.format
(input_category))
return [-1, '']
else: else:
usercat = 'ALL' section = core.CFG.findsection('UNCAT').isenabled()
usercat = 'UNCAT'
if section is None: # We haven't found any categories to process.
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
(input_category))
return [-1, '']
if len(section) > 1: if len(section) > 1:
logger.error('Category:[{0}] is not unique, {1} are using it. ' logger.error('Category:[{0}] is not unique, {1} are using it. '