From 37132de4fc886bbfc57a4ea64c7de9c24b734887 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Sun, 22 Mar 2026 21:34:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(ALTimerTaskManageWidget):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=87=8D=E5=A4=8D=E6=80=A7=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=A0=E9=99=A4=E6=97=B6=E5=9B=A0=20history=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=20len(int)=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui/ALTimerTaskManageWidget.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/ALTimerTaskManageWidget.py b/src/gui/ALTimerTaskManageWidget.py index 74060a6..247e12a 100644 --- a/src/gui/ALTimerTaskManageWidget.py +++ b/src/gui/ALTimerTaskManageWidget.py @@ -383,12 +383,17 @@ class ALTimerTaskManageWidget(QWidget, Ui_ALTimerTaskManageWidget): timer_task: dict ): + if "history" not in timer_task: + history = [] + else: + history = timer_task["history"] + history_count = len(history) return ( f"任务名称:{timer_task["name"]}\n" f"添加时间:{timer_task["added_time"]}\n" f"当前状态:{timer_task["status"].value}\n" f"下次执行时间:{datetime.strftime(timer_task["execute_time"], "%Y-%m-%d %H:%M:%S")}\n" - f"已记录次数:{len(timer_task['history'] if 'history' in timer_task else 0)}" + f"已记录次数:{history_count}" )