mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-14 02:00:31 +08:00
fix plugin actions api
This commit is contained in:
@@ -57,7 +57,8 @@ class InvokePluginAction(BaseAction):
|
||||
if not plugin_actions:
|
||||
logger.error(f"插件不存在: {params.plugin_id}")
|
||||
return context
|
||||
action = next((action for action in plugin_actions if action.action_id == params.action_id), None)
|
||||
actions = plugin_actions[0].get("actions", [])
|
||||
action = next((action for action in actions if action.action_id == params.action_id), None)
|
||||
if not action or not action.get("func"):
|
||||
logger.error(f"插件动作不存在: {params.plugin_id} - {params.action_id}")
|
||||
return context
|
||||
|
||||
@@ -44,8 +44,8 @@ def create_workflow(workflow: schemas.Workflow,
|
||||
return schemas.Response(success=True, message="创建工作流成功")
|
||||
|
||||
|
||||
@router.get("/actions/{plugin_id}", summary="查询插件动作", response_model=List[dict])
|
||||
def list_plugin_actions(plugin_id: str, _: schemas.TokenPayload = Depends(get_current_active_user)) -> Any:
|
||||
@router.get("/plugin/actions", summary="查询插件动作", response_model=List[dict])
|
||||
def list_plugin_actions(plugin_id: str = None, _: schemas.TokenPayload = Depends(get_current_active_user)) -> Any:
|
||||
"""
|
||||
获取所有动作
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user