feat(matrix): 悬停里的每条视频显示自己的赞/评/藏/转
一格合并了多条时,并集只能说明「这天整体怎么样」,哪条是爆款要看每条自己的 数字。后端在 details 里带上各自的最近一轮指标,提示里缩进显示在该条标题下面。
This commit is contained in:
+12
-3
@@ -1549,8 +1549,11 @@ async def daily_tag_matrix(
|
||||
"cells": {"2026-10-21": {"<hash>": {
|
||||
"count": 2, "tags": ["大字报", "养号"],
|
||||
"likes": 120, "comments": 8, "collected": 30, "shares": 4,
|
||||
"details": [{"title": "…", "tags": ["大字报"]},
|
||||
{"title": "…", "tags": ["养号"]}], # 按发布时间正序
|
||||
"details": [{"title": "…", "tags": ["大字报"],
|
||||
"likes": 80, "comments": 5, "collected": 20, "shares": 4},
|
||||
{"title": "…", "tags": ["养号"],
|
||||
"likes": 40, "comments": 3, "collected": 10, "shares": 0}],
|
||||
# 按发布时间正序
|
||||
}}}}
|
||||
|
||||
``likes/comments/collected/shares`` 是当天这些作品**最近一轮**指标的和;
|
||||
@@ -1727,17 +1730,23 @@ async def daily_tag_matrix(
|
||||
},
|
||||
)
|
||||
bucket["count"] += 1
|
||||
metric = latest_metric.get((row.task_id, row.note_id))
|
||||
# 逐条明细带**各自的**指标。一格合并了多条时,并集只说明「这天整体怎么样」,
|
||||
# 哪条是爆款要看每条自己的数字 —— 悬停提示里直接看得到。
|
||||
bucket["details"].append(
|
||||
{
|
||||
"title": row.title or row.note_id,
|
||||
"tags": list(tags_by_note.get(row.note_id, [])),
|
||||
"likes": metric.liked_count if metric is not None else None,
|
||||
"comments": metric.comment_count if metric is not None else None,
|
||||
"collected": metric.collected_count if metric is not None else None,
|
||||
"shares": metric.share_count if metric is not None else None,
|
||||
}
|
||||
)
|
||||
for tag in tags_by_note.get(row.note_id, []):
|
||||
if tag not in bucket["tags"]:
|
||||
bucket["tags"].append(tag)
|
||||
|
||||
metric = latest_metric.get((row.task_id, row.note_id))
|
||||
if metric is not None:
|
||||
for column, key in (
|
||||
("liked_count", "likes"),
|
||||
|
||||
Reference in New Issue
Block a user