From 0465fa77c294f372f1a365a54cdce639e7b23389 Mon Sep 17 00:00:00 2001 From: shaw <53377526+jtcymc@users.noreply.github.com> Date: Fri, 11 Jul 2025 20:02:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(filemanager):=20=E6=A3=80=E6=9F=A5=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E5=AA=92=E4=BD=93=E5=BA=93=E7=9B=AE=E5=BD=95=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在文件整理过程中,增加对目标媒体库目录是否设置的检查- 如果目标媒体库目录未设置,返回错误信息并中断整理过程 - 优化了错误处理逻辑,提高了系统的稳定性和可靠性 --- app/modules/filemanager/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/modules/filemanager/__init__.py b/app/modules/filemanager/__init__.py index 719d050e..53523799 100644 --- a/app/modules/filemanager/__init__.py +++ b/app/modules/filemanager/__init__.py @@ -429,6 +429,12 @@ class FileManagerModule(_ModuleBase): message=f"{target_path} 不是有效目录") # 获取目标路径 if target_directory: + # 目标媒体库目录未设置 + if not target_directory.library_path: + logger.error(f"目标媒体库目录未设置,无法整理文件,源路径:{fileitem.path}") + return TransferInfo(success=False, + fileitem=fileitem, + message="目标媒体库目录未设置") # 整理方式 if not transfer_type: transfer_type = target_directory.transfer_type