From 50d24db0af4166d102e1507151773c9fc4c89b12 Mon Sep 17 00:00:00 2001 From: timxx <3337598077@qq.com> Date: Wed, 7 Oct 2026 20:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20YYB/YYB=5FBJY.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YYB/YYB_BJY.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/YYB/YYB_BJY.py b/YYB/YYB_BJY.py index 07292ea..e04dca5 100644 --- a/YYB/YYB_BJY.py +++ b/YYB/YYB_BJY.py @@ -813,7 +813,8 @@ def fetch_task_list(server: str, task_type: str, username: str, proxies) -> List return [item for item in data if isinstance(item, dict)] -def summarize_tasks(tasks: List[Dict[str, Any]]) -> str: +def summarize_task_list(tasks: List[Dict[str, Any]]) -> str: + """任务列表摘要:X/N 已完成 + 待完成标题(供 run_welfare_tasks 使用,勿与通知版 summarize_tasks 混淆)。""" done = sum(1 for item in tasks if to_int(item.get("is_done")) == 1) pending = [str(item.get("title") or item.get("type")) for item in tasks if to_int(item.get("is_done")) != 1] text = f"{done}/{len(tasks)} 已完成" @@ -874,7 +875,7 @@ def run_welfare_tasks(server: str, token: str, username: str, proxies) -> str: fav_flag = "" if isinstance(profile, dict) and profile.get("weapp_fav") is not None: fav_flag = f",资料 weapp_fav={profile.get('weapp_fav', '?')}" - result = summarize_tasks(refreshed) + result = summarize_task_list(refreshed) if action_messages: result += ";已处理:" + ";".join(action_messages[:5]) result += fav_flag @@ -1424,4 +1425,4 @@ def main() -> None: if __name__ == "__main__": - main() \ No newline at end of file + main()