Skip to content

Commit

Permalink
Fix for module settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tblock79 committed Aug 14, 2024
1 parent deb253e commit 8a2ccf0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1-beta.9
0.3.1-beta.10
4 changes: 1 addition & 3 deletions process/process_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,7 @@ async def process_series(folder: Path) -> None:
# As far as the processing step is concerned, theres' only one processing step and it's this one,
# so we copy this one's information into a copy of the task file and hand that to the container.
copied_task.process = task_processing
# The settings currently only exist in the first list entry of the processing modules. Therefore,
# take the settings from there.
copied_task.process.settings = task.process[0].settings

with open(folder / "in" / mercure_names.TASKFILE,"w") as task_file:
json.dump(copied_task.dict(), task_file)

Expand Down
9 changes: 3 additions & 6 deletions routing/generate_taskfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,11 @@ def add_processing(uid: str, applied_rule: str, tags_list: Dict[str, str]) -> Op
if module_config is not None:
settings.update(module_config.settings)

rule_settings: List[Dict[str,Any]] = []
if isinstance(applied_rule_info.processing_settings,list):
rule_settings = applied_rule_info.processing_settings
if i < len(applied_rule_info.processing_settings):
settings.update(applied_rule_info.processing_settings[i])
else:
rule_settings = [applied_rule_info.processing_settings]

if i < len(rule_settings):
settings.update(rule_settings[i])
settings.update(applied_rule_info.processing_settings)

# Store in the target structure
process_info: TaskProcessing = TaskProcessing(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def make_config(action, trigger_reception, trigger_completion, trigger_completio
notification_webhook="",
notification_email="test@localhost, test2@localhost",
processing_module=["test_module_1", "test_module_2"],
processing_settings=[{"foo":"bar"},{"bar":"baz"}],
processing_settings={"foo":"bar", "bar":"baz"},
processing_retain_images=True,
notification_trigger_completion=trigger_completion,
notification_trigger_reception=trigger_reception,
Expand Down

0 comments on commit 8a2ccf0

Please sign in to comment.