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