mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
add singular fork detection for multiple runs. Fixes #1637
This commit is contained in:
parent
f21e18b1bf
commit
a633e91af0
2 changed files with 8 additions and 0 deletions
|
@ -198,6 +198,7 @@ META_CONTAINER = []
|
|||
|
||||
SECTIONS = []
|
||||
CATEGORIES = []
|
||||
FORK_SET = []
|
||||
|
||||
MOUNTED = None
|
||||
GETSUBS = False
|
||||
|
@ -859,6 +860,7 @@ def configure_passwords_file():
|
|||
def configure_sections(section):
|
||||
global SECTIONS
|
||||
global CATEGORIES
|
||||
global FORK_SET
|
||||
# check for script-defied section and if None set to allow sections
|
||||
SECTIONS = CFG[
|
||||
tuple(x for x in CFG if CFG[x].sections and CFG[x].isenabled())
|
||||
|
@ -867,6 +869,7 @@ def configure_sections(section):
|
|||
for section, subsections in SECTIONS.items():
|
||||
CATEGORIES.extend([subsection for subsection in subsections if CFG[section][subsection].isenabled()])
|
||||
CATEGORIES = list(set(CATEGORIES))
|
||||
FORK_SET = []
|
||||
|
||||
|
||||
def configure_utility_locations():
|
||||
|
|
|
@ -45,6 +45,10 @@ def api_check(r, params, rem_params):
|
|||
def auto_fork(section, input_category):
|
||||
# auto-detect correct section
|
||||
# config settings
|
||||
if core.FORK_SET: # keep using determined fork for multiple (manual) post-processing
|
||||
logger.info('{section}:{category} fork set to {fork}'.format
|
||||
(section=section, category=input_category, fork=core.FORK_SET[0]))
|
||||
return core.FORK_SET[0], core.FORK_SET[1]
|
||||
|
||||
cfg = dict(core.CFG[section][input_category])
|
||||
|
||||
|
@ -168,4 +172,5 @@ def auto_fork(section, input_category):
|
|||
|
||||
logger.info('{section}:{category} fork set to {fork}'.format
|
||||
(section=section, category=input_category, fork=fork[0]))
|
||||
core.FORK_SET = fork
|
||||
return fork[0], fork[1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue