This commit is contained in:
jxxghp 2023-08-23 12:27:54 +08:00
parent d59ed1e160
commit 6f159958a1
2 changed files with 6 additions and 4 deletions

View File

@ -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}")

View File

@ -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: