No status change error suppression (#1786)

This commit is contained in:
Clinton Hall 2020-10-15 21:59:43 +13:00 committed by GitHub
commit a96f07c261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -68,6 +68,8 @@
method = renamer method = renamer
delete_failed = 0 delete_failed = 0
wait_for = 2 wait_for = 2
# Set this to suppress error if no status change after rename called
no_status_check = 0
extract = 1 extract = 1
# Set this to minimum required size to consider a media file valid (in MB) # Set this to minimum required size to consider a media file valid (in MB)
minSize = 0 minSize = 0

View file

@ -59,6 +59,7 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
remote_path = int(cfg.get('remote_path', 0)) remote_path = int(cfg.get('remote_path', 0))
protocol = 'https://' if ssl else 'http://' protocol = 'https://' if ssl else 'http://'
omdbapikey = cfg.get('omdbapikey', '') omdbapikey = cfg.get('omdbapikey', '')
no_status_check = int(cfg.get('no_status_check', 0))
status = int(status) status = int(status)
if status > 0 and core.NOEXTRACTFAILED: if status > 0 and core.NOEXTRACTFAILED:
extract = 0 extract = 0
@ -465,6 +466,11 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
'{0} does not appear to have changed status after {1} minutes, Please check your logs.'.format(input_name, wait_for), '{0} does not appear to have changed status after {1} minutes, Please check your logs.'.format(input_name, wait_for),
section, section,
) )
if no_status_check:
return ProcessResult(
status_code=0,
message='{0}: Successfully processed but no change in status confirmed'.format(section),
)
return ProcessResult( return ProcessResult(
status_code=1, status_code=1,
message='{0}: Failed to post-process - No change in status'.format(section), message='{0}: Failed to post-process - No change in status'.format(section),