This commit is contained in:
jxxghp
2023-10-14 20:16:15 +08:00
parent 9191ed0a21
commit 202fdf8905
2 changed files with 10 additions and 3 deletions

View File

@ -46,11 +46,14 @@ def manual_transfer(path: str = None,
:param db: 数据库
:param _: Token校验
"""
force = False
if logid:
# 查询历史记录
history = TransferHistory.get(db, logid)
if not history:
return schemas.Response(success=False, message=f"历史记录不存在ID{logid}")
# 强制转移
force = True
# 源路径
in_path = Path(history.src)
# 目的路径
@ -87,7 +90,8 @@ def manual_transfer(path: str = None,
season=season,
transfer_type=transfer_type,
epformat=epformat,
min_filesize=min_filesize
min_filesize=min_filesize,
force=force
)
# 失败
if not state:

View File

@ -539,7 +539,8 @@ class TransferChain(ChainBase):
season: int = None,
transfer_type: str = None,
epformat: EpisodeFormat = None,
min_filesize: int = 0) -> Tuple[bool, Union[str, list]]:
min_filesize: int = 0,
force: bool = False) -> Tuple[bool, Union[str, list]]:
"""
手动转移,支持复杂条件,带进度显示
:param in_path: 源文件路径
@ -550,6 +551,7 @@ class TransferChain(ChainBase):
:param transfer_type: 转移类型
:param epformat: 剧集格式
:param min_filesize: 最小文件大小(MB)
:param force: 是否强制转移
"""
logger.info(f"手动转移:{in_path} ...")
@ -571,7 +573,8 @@ class TransferChain(ChainBase):
target=target,
season=season,
epformat=epformat,
min_filesize=min_filesize
min_filesize=min_filesize,
force=force
)
if not state:
return False, errmsg