diff --git a/app/modules/filetransfer/__init__.py b/app/modules/filetransfer/__init__.py index fa3a1da3..e1d12977 100644 --- a/app/modules/filetransfer/__init__.py +++ b/app/modules/filetransfer/__init__.py @@ -473,7 +473,7 @@ class FileTransferModule(_ModuleBase): # 目的文件清单 file_list_new.append(str(new_file)) # 计算总大小 - total_filesize += transfer_file.stat().st_size + total_filesize += new_file.stat().st_size except Exception as err: err_msgs.append(f"{transfer_file.name}:{err}") logger.error(f"{transfer_file}转移失败:{err}") diff --git a/app/plugins/dirmonitor/__init__.py b/app/plugins/dirmonitor/__init__.py index b3bfa96e..42ed1fa4 100644 --- a/app/plugins/dirmonitor/__init__.py +++ b/app/plugins/dirmonitor/__init__.py @@ -124,14 +124,16 @@ class DirMonitor(_PluginBase): # 存储目的目录 paths = mon_path.split(":") + target_path = None if len(paths) > 1: mon_path = paths[0] - self._dirconf[mon_path] = Path(paths[1]) + target_path = Path(paths[1]) + self._dirconf[mon_path] = target_path # 检查目录是不是媒体库目录的子目录 try: - if Path(mon_path).is_relative_to(settings.LIBRARY_PATH): - logger.warn(f"{mon_path} 是媒体库目录的子目录,无法监控") + if Path(mon_path).is_relative_to(target_path or settings.LIBRARY_PATH): + logger.warn(f"{mon_path} 是媒体库目录/目的目录的子目录,无法监控") self.systemmessage.put(f"{mon_path} 是媒体库目录的子目录,无法监控") continue except Exception as e: