diff --git a/app/chain/transfer.py b/app/chain/transfer.py index 33b6afd6..0e2371e0 100644 --- a/app/chain/transfer.py +++ b/app/chain/transfer.py @@ -215,8 +215,9 @@ class TransferChain(ChainBase): self.obtain_images(mediainfo=file_mediainfo) if not download_hash: - # TODO 查找下载记录 download_hash - pass + download_file = self.downloadhis.get_file_by_fullpath(file_path_str) + if download_file: + download_hash = download_file.download_hash # 执行转移 transferinfo: TransferInfo = self.transfer(meta=file_meta, diff --git a/app/modules/filetransfer/__init__.py b/app/modules/filetransfer/__init__.py index 90831cad..d1107bfc 100644 --- a/app/modules/filetransfer/__init__.py +++ b/app/modules/filetransfer/__init__.py @@ -440,7 +440,7 @@ class FileTransferModule(_ModuleBase): if retcode != 0: logger.error(f"文件 {in_path} 转移失败,错误码:{retcode}") return TransferInfo(message=f"文件 {in_path.name} 转移失败,错误码:{retcode}", - fail_list=[in_path]) + fail_list=[str(in_path)]) logger.info(f"文件 {in_path} 转移成功") return TransferInfo(path=in_path, @@ -448,8 +448,8 @@ class FileTransferModule(_ModuleBase): file_count=1, total_size=new_file.stat().st_size, is_bluray=False, - file_list=[in_path], - file_list_new=[new_file]) + file_list=[str(in_path)], + file_list_new=[str(new_file)]) @staticmethod def __get_naming_dict(meta: MetaBase, mediainfo: MediaInfo, file_ext: str = None) -> dict: