fix actions

This commit is contained in:
jxxghp
2025-02-27 13:09:01 +08:00
parent 4a42b0d000
commit ab0008be86
16 changed files with 116 additions and 29 deletions
+7 -1
View File
@@ -1,3 +1,5 @@
from pathlib import Path
from app.actions import BaseAction
from app.schemas import ActionParams, ActionContext
from app.chain.storage import StorageChain
@@ -32,6 +34,10 @@ class TransferFileAction(BaseAction):
def description(self) -> str:
return "整理和转移文件"
@property
def data(self) -> dict:
return TransferFileParams().dict()
@property
def success(self) -> bool:
return True if self.__fileitems else False
@@ -44,7 +50,7 @@ class TransferFileAction(BaseAction):
if not download.completed:
logger.info(f"下载任务 {download.download_id} 未完成")
continue
fileitem = self.storagechain.get_file_item(storage="local", path=download.path)
fileitem = self.storagechain.get_file_item(storage="local", path=Path(download.path))
if not fileitem:
logger.info(f"文件 {download.path} 不存在")
continue