mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-12 19:21:05 +08:00
feat(workflow): implement action contract management for inputs and outputs
This commit is contained in:
@@ -242,6 +242,7 @@ class WorkFlowManager(metaclass=Singleton):
|
||||
"type": key,
|
||||
"name": action.name,
|
||||
"description": action.description,
|
||||
"contract": action.get_contract(),
|
||||
"data": {
|
||||
"label": action.name,
|
||||
**action.data
|
||||
@@ -249,6 +250,15 @@ class WorkFlowManager(metaclass=Singleton):
|
||||
} for key, action in self._actions.items()
|
||||
]
|
||||
|
||||
def get_action_contract(self, action_type: str) -> dict:
|
||||
"""
|
||||
获取动作输入输出契约。
|
||||
"""
|
||||
action = self._actions.get(action_type)
|
||||
if not action or not hasattr(action, "get_contract"):
|
||||
return {}
|
||||
return action.get_contract()
|
||||
|
||||
def update_workflow_event(self, workflow: Workflow):
|
||||
"""
|
||||
更新工作流事件触发器
|
||||
|
||||
Reference in New Issue
Block a user