From f20c81efaede009c563d804274ff2eaf9bccd0e1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 12 Oct 2023 20:47:23 +0800 Subject: [PATCH] fix rclone --- app/modules/filetransfer/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/modules/filetransfer/__init__.py b/app/modules/filetransfer/__init__.py index 4927212c..6b2c4ae8 100644 --- a/app/modules/filetransfer/__init__.py +++ b/app/modules/filetransfer/__init__.py @@ -402,6 +402,8 @@ class FileTransferModule(_ModuleBase): bluray_flag = SystemUtils.is_bluray_dir(in_path) if bluray_flag: logger.info(f"{in_path} 是蓝光原盘文件夹") + # 原文件大小 + file_size = in_path.stat().st_size # 目的路径 new_path = self.get_rename_path( path=target_dir, @@ -426,7 +428,7 @@ class FileTransferModule(_ModuleBase): return TransferInfo(success=True, path=in_path, target_path=new_path, - total_size=new_path.stat().st_size, + total_size=file_size, is_bluray=bluray_flag) else: # 转移单个文件 @@ -467,7 +469,8 @@ class FileTransferModule(_ModuleBase): if new_file.stat().st_size < in_path.stat().st_size: logger.info(f"目标文件已存在,但文件大小更小,将覆盖:{new_file}") overflag = True - + # 原文件大小 + file_size = in_path.stat().st_size # 转移文件 retcode = self.__transfer_file(file_item=in_path, new_file=new_file, @@ -486,7 +489,7 @@ class FileTransferModule(_ModuleBase): path=in_path, target_path=new_file, file_count=1, - total_size=new_file.stat().st_size, + total_size=file_size, is_bluray=False, file_list=[str(in_path)], file_list_new=[str(new_file)])