1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 08:59:25 +08:00

add: get task name when notify user that the task disabled

This commit is contained in:
0O0o0oOoO00
2025-09-23 23:43:42 +08:00
parent f4cd7a70ff
commit bc7213001d

View File

@@ -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: