mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 03:27:31 +08:00
fix actions
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from pydantic.main import BaseModel
|
||||
|
||||
from app.chain import ChainBase
|
||||
from app.schemas import ActionContext, ActionParams
|
||||
|
||||
@@ -10,7 +8,7 @@ class ActionChain(ChainBase):
|
||||
pass
|
||||
|
||||
|
||||
class BaseAction(BaseModel, ABC):
|
||||
class BaseAction(ABC):
|
||||
"""
|
||||
工作流动作基类
|
||||
"""
|
||||
@@ -18,10 +16,6 @@ class BaseAction(BaseModel, ABC):
|
||||
# 完成标志
|
||||
_done_flag = False
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.chain = ActionChain()
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self) -> str:
|
||||
@@ -32,6 +26,11 @@ class BaseAction(BaseModel, ABC):
|
||||
def description(self) -> str:
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def data(self) -> dict:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def execute(self, params: ActionParams, context: ActionContext) -> ActionContext:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user