add TransferInfo增加目标文件清单
This commit is contained in:
parent
2ede2cc843
commit
c7fe0a15d9
@ -52,7 +52,7 @@ class FileTransferModule(_ModuleBase):
|
||||
if isinstance(result, str):
|
||||
return TransferInfo(message=result)
|
||||
# 解包结果
|
||||
is_bluray, target_path, file_list, file_size, fail_list, msg = result
|
||||
is_bluray, target_path, file_list, file_list_new, file_size, fail_list, msg = result
|
||||
# 返回
|
||||
return TransferInfo(path=path,
|
||||
target_path=target_path,
|
||||
@ -61,7 +61,8 @@ class FileTransferModule(_ModuleBase):
|
||||
total_size=file_size,
|
||||
fail_list=fail_list,
|
||||
is_bluray=is_bluray,
|
||||
file_list=file_list)
|
||||
file_list=file_list,
|
||||
file_list_new=file_list_new)
|
||||
|
||||
@staticmethod
|
||||
def __transfer_command(file_item: Path, target_file: Path, transfer_type: str) -> int:
|
||||
@ -378,6 +379,9 @@ class FileTransferModule(_ModuleBase):
|
||||
# 处理文件清单
|
||||
file_list = []
|
||||
|
||||
# 目标文件清单
|
||||
file_list_new = []
|
||||
|
||||
# 失败文件清单
|
||||
fail_list = []
|
||||
|
||||
@ -489,6 +493,7 @@ class FileTransferModule(_ModuleBase):
|
||||
continue
|
||||
# 计算文件数
|
||||
file_list.append(str(transfer_file))
|
||||
file_list_new.append(str(new_file))
|
||||
# 计算大小
|
||||
total_filesize += transfer_file.stat().st_size
|
||||
except Exception as err:
|
||||
|
@ -45,6 +45,8 @@ class TransferInfo(BaseModel):
|
||||
file_count: Optional[int] = 0
|
||||
# 处理文件清单
|
||||
file_list: Optional[list] = []
|
||||
# 目标文件清单
|
||||
file_list_new: Optional[list] = []
|
||||
# 总文件大小
|
||||
total_size: Optional[float] = 0
|
||||
# 失败清单
|
||||
|
Loading…
x
Reference in New Issue
Block a user