From d097ef45ebba751e6b219aa93d54c6bb7cb65c2a Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 19 Sep 2023 16:44:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=BD=93=E5=89=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=8B=E6=B2=A1=E6=9C=89=E5=AA=92=E4=BD=93=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=99=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/transfer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/chain/transfer.py b/app/chain/transfer.py index f7d8f470..12236fee 100644 --- a/app/chain/transfer.py +++ b/app/chain/transfer.py @@ -635,7 +635,7 @@ class TransferChain(ChainBase): break if str(parent_path.parent) != str(path.root): # 父目录非根目录,才删除父目录 - files = SystemUtils.list_files(parent_path, settings.RMT_MEDIAEXT) - if not files: + if not SystemUtils.exits_files(path.parent, settings.RMT_MEDIAEXT): + # 当前路径下没有媒体文件则删除 shutil.rmtree(parent_path) logger.warn(f"目录 {parent_path} 已删除")