feat(计划): 评论计划勾选项 + 待评论计数

- ae_plan 新增 comment_mode(schema v26)
- 计划编辑器勾「评论计划」:账号显示待评论 N、隐藏视频未发/素材区,段内禁止发布素材
- list_accounts 带 comment_pending;comment.pending_counts 按账号汇总
- 计划列表显示评论待处理总数与「评论」标签
- 测试 test_comment/test_plan
This commit is contained in:
2026-10-31 10:12:34 +08:00
parent d5114dbf53
commit b9bee52878
11 changed files with 134 additions and 19 deletions
+5
View File
@@ -21,6 +21,7 @@ os.chdir(_ROOT)
from flask import Flask # noqa: E402
from core.models import db, init_db, DeviceAccount, CommentItem # noqa: E402
from core import comment as cm # noqa: E402
from core import account_folder as af # noqa: E402
from tasks.generic import task as gt # noqa: E402
fails = []
@@ -39,6 +40,7 @@ app.config["SQLALCHEMY_DATABASE_URI"] = os.environ["DATABASE_URL"]
with app.app_context():
init_db(app)
cm.init_app(app)
af._app = app
def reset_db():
@@ -80,6 +82,9 @@ with app.app_context():
row = CommentItem.query.filter_by(account_name="号甲").first()
check("入库 pending", row.status, "pending")
check("account_id", row.account_id, "a1")
_accts = af.list_accounts()
_acct = [x for x in _accts if x["name"] == "号甲"][0]
check("资产表带待评论数", _acct.get("comment_pending"), 1)
r = cm.import_comments(txt.replace("第一条", "改过的"))
check("重复导入更新", (r["added"], r["updated"]), (0, 1))
with app.app_context():