feat(计划): 评论计划勾选项 + 待评论计数
- ae_plan 新增 comment_mode(schema v26) - 计划编辑器勾「评论计划」:账号显示待评论 N、隐藏视频未发/素材区,段内禁止发布素材 - list_accounts 带 comment_pending;comment.pending_counts 按账号汇总 - 计划列表显示评论待处理总数与「评论」标签 - 测试 test_comment/test_plan
This commit is contained in:
@@ -169,6 +169,11 @@ def list_accounts(prof=None):
|
||||
roster = {r["nickname"]: r for r in roster_rows() if r.get("nickname")}
|
||||
except Exception:
|
||||
roster = {}
|
||||
try:
|
||||
from core import comment as _comment
|
||||
comment_counts = _comment.pending_counts()
|
||||
except Exception:
|
||||
comment_counts = {"by_id": {}, "by_name": {}}
|
||||
all_names = sorted(dirs | set(roster.keys()))
|
||||
for name in all_names:
|
||||
d = os.path.join(root, name)
|
||||
@@ -185,8 +190,11 @@ def list_accounts(prof=None):
|
||||
last = (AeRun.query.filter(AeRun.account == name)
|
||||
.order_by(AeRun.started_at.desc()).first())
|
||||
rr = roster.get(name) or {}
|
||||
cp = ((comment_counts.get("by_id") or {}).get(rr.get("id") or "")
|
||||
or (comment_counts.get("by_name") or {}).get(name) or 0)
|
||||
out.append({"name": name, "media": media, "pending": pending, "done": done,
|
||||
"total": total, "need_text": need_text,
|
||||
"comment_pending": int(cp or 0),
|
||||
"unscanned": max(0, media - total),
|
||||
"has_dir": has_dir,
|
||||
"device_name": rr.get("device_name") or "",
|
||||
|
||||
Reference in New Issue
Block a user