From bc7213001da5ec84a4a971c9f503fdac2c02eca5 Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Tue, 23 Sep 2025 23:43:42 +0800 Subject: [PATCH] add: get task name when notify user that the task disabled --- alas.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/alas.py b/alas.py index e50496b4a..6a5e0eb8b 100644 --- a/alas.py +++ b/alas.py @@ -592,6 +592,7 @@ from datetime import datetime, timedelta from module.counter import MaxCounter from typing import Dict from module.device.my_assets import my_OTHERS_LOGIN_CONFIRM +from module.config.utils import filepath_i18n, read_file class FailedTaskCounter: @@ -956,6 +957,12 @@ class AzurLaneAutoScript(AzurLaneAutoScript): AzurLaneConfig.is_hoarding_task = False return task.command + def get_task_name(self, task): + try: + return read_file(filepath_i18n('zh-CN'))[task]["_info"]["name"] + except KeyError: + return task + def loop(self): if self.is_azur: CrackResource(self.config, self.device).ensure() @@ -1035,7 +1042,7 @@ class AzurLaneAutoScript(AzurLaneAutoScript): self.repeated_failed_task_counter.reset() handle_notify( self.config.Error_OnePushConfig, - title=f"Alas <{self.config_name}> disabled `{task}`", + title=f"Alas <{self.config_name}> disabled `{self.get_task_name(task)}`", content=msg, ) else: