This commit is contained in:
jxxghp 2023-10-17 17:24:25 +08:00
parent bd2ef934d9
commit be4df15d01
2 changed files with 6 additions and 4 deletions

View File

@ -57,7 +57,7 @@ def manual_transfer(path: str = None,
# 源路径 # 源路径
in_path = Path(history.src) in_path = Path(history.src)
# 目的路径 # 目的路径
if history.dest: if history.dest and str(history.dest) != "None":
# 删除旧的已整理文件 # 删除旧的已整理文件
TransferChain(db).delete_files(Path(history.dest)) TransferChain(db).delete_files(Path(history.dest))
if not target: if not target:
@ -67,8 +67,10 @@ def manual_transfer(path: str = None,
else: else:
return schemas.Response(success=False, message=f"缺少参数path/logid") return schemas.Response(success=False, message=f"缺少参数path/logid")
if target: if target and target != "None":
target = Path(target) target = Path(target)
else:
target = None
# 类型 # 类型
mtype = MediaType(type_name) if type_name else None mtype = MediaType(type_name) if type_name else None

View File

@ -119,7 +119,7 @@ class TransferHistoryOper(DbOper):
""" """
self.add_force( self.add_force(
src=str(src_path), src=str(src_path),
dest=str(transferinfo.target_path), dest=str(transferinfo.target_path or ''),
mode=mode, mode=mode,
type=mediainfo.type.value, type=mediainfo.type.value,
category=mediainfo.category, category=mediainfo.category,
@ -145,7 +145,7 @@ class TransferHistoryOper(DbOper):
if mediainfo and transferinfo: if mediainfo and transferinfo:
his = self.add_force( his = self.add_force(
src=str(src_path), src=str(src_path),
dest=str(transferinfo.target_path), dest=str(transferinfo.target_path or ''),
mode=mode, mode=mode,
type=mediainfo.type.value, type=mediainfo.type.value,
category=mediainfo.category, category=mediainfo.category,