modified: main.py

This commit is contained in:
2026-05-16 16:01:22 +08:00
parent e62d520bba
commit 057cfc3292
+7 -1
View File
@@ -378,7 +378,7 @@ class MyPlugin(Star):
decoded_name = decoded_name.decode()
except Exception as e:
# 文件名解析失败 自动生成新名字
decoded_name,filename = f"{from_header}{mail_date}.zip"
decoded_name = filename = f"{from_header}{mail_date}.zip"
today_str = datetime.now().strftime("%Y%m%d") # 获取当前日期字符串
base_name, ext = os.path.splitext(decoded_name) # 拆分文件名和扩展名
# 生成新文件名格式:YYYYMMDD-原文件名.zip
@@ -400,3 +400,9 @@ class MyPlugin(Star):
async def terminate(self):
"""可选择实现异步的插件销毁方法,当插件被卸载/停用时会调用。"""
try:
self.rwebui = False
self.config.save_config() # 保存配置
stop_server()
except Exception as e:
logger.info("停止服务")