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: