mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-11 18:50:59 +08:00
fix
This commit is contained in:
@@ -21,19 +21,19 @@ class BaseAction(ABC):
|
|||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -36,17 +36,17 @@ class AddDownloadAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "添加下载"
|
return "添加下载"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "根据资源列表添加下载任务"
|
return "根据资源列表添加下载任务"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return AddDownloadParams().dict()
|
return AddDownloadParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -29,17 +29,17 @@ class AddSubscribeAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "添加订阅"
|
return "添加订阅"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "根据媒体列表添加订阅"
|
return "根据媒体列表添加订阅"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return AddSubscribeParams().dict()
|
return AddSubscribeParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ class FetchDownloadsAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "获取下载任务"
|
return "获取下载任务"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "获取下载队列中的任务状态"
|
return "获取下载队列中的任务状态"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FetchDownloadsParams().dict()
|
return FetchDownloadsParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -100,17 +100,17 @@ class FetchMediasAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "获取媒体数据"
|
return "获取媒体数据"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "获取榜单等媒体数据列表"
|
return "获取榜单等媒体数据列表"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FetchMediasParams().dict()
|
return FetchMediasParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -38,17 +38,17 @@ class FetchRssAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "获取RSS资源"
|
return "获取RSS资源"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "订阅RSS地址获取资源"
|
return "订阅RSS地址获取资源"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FetchRssParams().dict()
|
return FetchRssParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -36,17 +36,17 @@ class FetchTorrentsAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "搜索站点资源"
|
return "搜索站点资源"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "搜索站点种子资源列表"
|
return "搜索站点种子资源列表"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FetchTorrentsParams().dict()
|
return FetchTorrentsParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -26,17 +26,17 @@ class FilterMediasAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "过滤媒体数据"
|
return "过滤媒体数据"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "对媒体数据列表进行过滤"
|
return "对媒体数据列表进行过滤"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FilterMediasParams().dict()
|
return FilterMediasParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -35,17 +35,17 @@ class FilterTorrentsAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "过滤资源"
|
return "过滤资源"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "对资源列表数据进行过滤"
|
return "对资源列表数据进行过滤"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return FilterTorrentsParams().dict()
|
return FilterTorrentsParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -33,17 +33,17 @@ class ScanFileAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "扫描目录"
|
return "扫描目录"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "扫描目录文件到队列"
|
return "扫描目录文件到队列"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return ScanFileParams().dict()
|
return ScanFileParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -31,17 +31,17 @@ class ScrapeFileAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "刮削文件"
|
return "刮削文件"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "刮削媒体信息和图片"
|
return "刮削媒体信息和图片"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return ScrapeFileParams().dict()
|
return ScrapeFileParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -18,17 +18,17 @@ class SendEventAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "发送事件"
|
return "发送事件"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "发送任务执行事件"
|
return "发送任务执行事件"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return SendEventParams().dict()
|
return SendEventParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -25,17 +25,17 @@ class SendMessageAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "发送消息"
|
return "发送消息"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "发送任务执行消息"
|
return "发送任务执行消息"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return SendMessageParams().dict()
|
return SendMessageParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -47,10 +47,10 @@ class SendMessageAction(BaseAction):
|
|||||||
发送messages中的消息
|
发送messages中的消息
|
||||||
"""
|
"""
|
||||||
params = SendMessageParams(**params)
|
params = SendMessageParams(**params)
|
||||||
msg_text = f"当前进度:{context.progress}%"
|
msg_text = f"当前进度:{context.__progress__}%"
|
||||||
index = 1
|
index = 1
|
||||||
if context.execute_history:
|
if context.__execute_history__:
|
||||||
for history in context.execute_history:
|
for history in context.__execute_history__:
|
||||||
if not history.message:
|
if not history.message:
|
||||||
continue
|
continue
|
||||||
msg_text += f"\n{index}. {history.action}:{history.message}"
|
msg_text += f"\n{index}. {history.action}:{history.message}"
|
||||||
|
|||||||
@@ -37,17 +37,17 @@ class TransferFileAction(BaseAction):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def name(cls) -> str:
|
def name(cls) -> str: # noqa
|
||||||
return "整理文件"
|
return "整理文件"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def description(cls) -> str:
|
def description(cls) -> str: # noqa
|
||||||
return "整理队列中的文件"
|
return "整理队列中的文件"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@property
|
@property
|
||||||
def data(cls) -> dict:
|
def data(cls) -> dict: # noqa
|
||||||
return TransferFileParams().dict()
|
return TransferFileParams().dict()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -135,10 +135,10 @@ class WorkflowExecutor:
|
|||||||
try:
|
try:
|
||||||
self.finished_actions += 1
|
self.finished_actions += 1
|
||||||
# 更新当前进度
|
# 更新当前进度
|
||||||
self.context.progress = round(self.finished_actions / self.total_actions) * 100
|
self.context.__progress__ = round(self.finished_actions / self.total_actions) * 100
|
||||||
|
|
||||||
# 补充执行历史
|
# 补充执行历史
|
||||||
self.context.execute_history.append(
|
self.context.__execute_history__.append(
|
||||||
ActionExecution(
|
ActionExecution(
|
||||||
action=action.name,
|
action=action.name,
|
||||||
result=state,
|
result=state,
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ class ActionContext(BaseModel):
|
|||||||
downloads: Optional[List[DownloadTask]] = Field([], description="下载任务列表")
|
downloads: Optional[List[DownloadTask]] = Field([], description="下载任务列表")
|
||||||
sites: Optional[List[Site]] = Field([], description="站点列表")
|
sites: Optional[List[Site]] = Field([], description="站点列表")
|
||||||
subscribes: Optional[List[Subscribe]] = Field([], description="订阅列表")
|
subscribes: Optional[List[Subscribe]] = Field([], description="订阅列表")
|
||||||
execute_history: Optional[List[ActionExecution]] = Field([], description="执行历史")
|
__execute_history__: Optional[List[ActionExecution]] = Field([], description="执行历史")
|
||||||
progress: Optional[int] = Field(0, description="执行进度(%)")
|
__progress__: Optional[int] = Field(0, description="执行进度(%)")
|
||||||
|
|
||||||
|
|
||||||
class ActionFlow(BaseModel):
|
class ActionFlow(BaseModel):
|
||||||
|
|||||||
Reference in New Issue
Block a user