更新 YYB/YYB_BJY.py
This commit is contained in:
+3
-2
@@ -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)]
|
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)
|
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]
|
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)} 已完成"
|
text = f"{done}/{len(tasks)} 已完成"
|
||||||
@@ -874,7 +875,7 @@ def run_welfare_tasks(server: str, token: str, username: str, proxies) -> str:
|
|||||||
fav_flag = ""
|
fav_flag = ""
|
||||||
if isinstance(profile, dict) and profile.get("weapp_fav") is not None:
|
if isinstance(profile, dict) and profile.get("weapp_fav") is not None:
|
||||||
fav_flag = f",资料 weapp_fav={profile.get('weapp_fav', '?')}"
|
fav_flag = f",资料 weapp_fav={profile.get('weapp_fav', '?')}"
|
||||||
result = summarize_tasks(refreshed)
|
result = summarize_task_list(refreshed)
|
||||||
if action_messages:
|
if action_messages:
|
||||||
result += ";已处理:" + ";".join(action_messages[:5])
|
result += ";已处理:" + ";".join(action_messages[:5])
|
||||||
result += fav_flag
|
result += fav_flag
|
||||||
|
|||||||
Reference in New Issue
Block a user