mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
Remove failed
parameter from process
This commit is contained in:
parent
0b02c1c1b5
commit
453a3e736c
1 changed files with 5 additions and 13 deletions
|
@ -38,7 +38,6 @@ def process(
|
||||||
dir_name: str,
|
dir_name: str,
|
||||||
input_name: str = '',
|
input_name: str = '',
|
||||||
status: int = 0,
|
status: int = 0,
|
||||||
failed: bool = False,
|
|
||||||
client_agent: str = 'manual',
|
client_agent: str = 'manual',
|
||||||
download_id: str = '',
|
download_id: str = '',
|
||||||
input_category: str = '',
|
input_category: str = '',
|
||||||
|
@ -79,7 +78,6 @@ def process(
|
||||||
force = int(cfg.get('force', 0))
|
force = int(cfg.get('force', 0))
|
||||||
delete_on = int(cfg.get('delete_on', 0))
|
delete_on = int(cfg.get('delete_on', 0))
|
||||||
ignore_subs = int(cfg.get('ignore_subs', 0))
|
ignore_subs = int(cfg.get('ignore_subs', 0))
|
||||||
status = int(failed)
|
|
||||||
|
|
||||||
# Begin processing
|
# Begin processing
|
||||||
|
|
||||||
|
@ -185,11 +183,9 @@ def process(
|
||||||
if valid_files == num_files and not status == 0:
|
if valid_files == num_files and not status == 0:
|
||||||
logger.info('Found Valid Videos. Setting status Success')
|
logger.info('Found Valid Videos. Setting status Success')
|
||||||
status = 0
|
status = 0
|
||||||
failed = 0
|
|
||||||
if valid_files < num_files and status == 0:
|
if valid_files < num_files and status == 0:
|
||||||
logger.info('Found corrupt videos. Setting status Failed')
|
logger.info('Found corrupt videos. Setting status Failed')
|
||||||
status = 1
|
status = 1
|
||||||
failed = 1
|
|
||||||
if (
|
if (
|
||||||
'NZBOP_VERSION' in os.environ
|
'NZBOP_VERSION' in os.environ
|
||||||
and os.environ['NZBOP_VERSION'][0:5] >= '14.0'
|
and os.environ['NZBOP_VERSION'][0:5] >= '14.0'
|
||||||
|
@ -220,23 +216,19 @@ def process(
|
||||||
logger.info(
|
logger.info(
|
||||||
'Check for media files ignored because nzbExtractionBy is set to Destination.',
|
'Check for media files ignored because nzbExtractionBy is set to Destination.',
|
||||||
)
|
)
|
||||||
if int(failed) == 0:
|
if status == 0:
|
||||||
logger.info('Setting Status Success.')
|
logger.info('Setting Status Success.')
|
||||||
status = 0
|
|
||||||
failed = 0
|
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info(
|
||||||
'Downloader reported an error during download or verification. Processing this as a failed download.',
|
'Downloader reported an error during download or verification. Processing this as a failed download.',
|
||||||
)
|
)
|
||||||
status = 1
|
status = 1
|
||||||
failed = 1
|
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f'No media files found in directory {dir_name}. Processing this as a failed download',
|
f'No media files found in directory {dir_name}. Processing this as a failed download',
|
||||||
section,
|
section,
|
||||||
)
|
)
|
||||||
status = 1
|
status = 1
|
||||||
failed = 1
|
|
||||||
if (
|
if (
|
||||||
'NZBOP_VERSION' in os.environ
|
'NZBOP_VERSION' in os.environ
|
||||||
and os.environ['NZBOP_VERSION'][0:5] >= '14.0'
|
and os.environ['NZBOP_VERSION'][0:5] >= '14.0'
|
||||||
|
@ -275,7 +267,7 @@ def process(
|
||||||
# Part of the refactor
|
# Part of the refactor
|
||||||
if init_sickbeard.fork_obj:
|
if init_sickbeard.fork_obj:
|
||||||
init_sickbeard.fork_obj.initialize(
|
init_sickbeard.fork_obj.initialize(
|
||||||
dir_name, input_name, failed, client_agent='manual',
|
dir_name, input_name, status, client_agent='manual',
|
||||||
)
|
)
|
||||||
|
|
||||||
# configure SB params to pass
|
# configure SB params to pass
|
||||||
|
@ -289,9 +281,9 @@ def process(
|
||||||
|
|
||||||
for param in copy.copy(fork_params):
|
for param in copy.copy(fork_params):
|
||||||
if param == 'failed':
|
if param == 'failed':
|
||||||
if failed > 1:
|
if status > 1:
|
||||||
failed = 1
|
status = 1
|
||||||
fork_params[param] = failed
|
fork_params[param] = status
|
||||||
if 'proc_type' in fork_params:
|
if 'proc_type' in fork_params:
|
||||||
del fork_params['proc_type']
|
del fork_params['proc_type']
|
||||||
if 'type' in fork_params:
|
if 'type' in fork_params:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue