feat(snapshot): refresh API video metadata; keep removed visible
入库 / 小时近新片 / 全量快照成功时以 view_detail 覆盖 title、duration、 pages、cover、bvid、up_*、pubdate 等接口字段,并照旧写七项快照。 原站失效仅标 removed,不删行、不空写元数据;列表与详情继续展示, 快照队列仍跳过 removed。
This commit is contained in:
1 parent
99b71c037c
commit
6c73904b25
8 files changed
+329
-34
No files matched your search
@@ -45,6 +45,8 @@ from ..timeutil import (
|
||||
from .cache import DASHBOARD_CACHE, TTL_FANS, TTL_VIDEOS, build_cache_key
|
||||
|
||||
TRACKED_STATUSES = ("active", "unfaved")
|
||||
# 站内列表可见:含原站失效 removed(继续展示、badge 可标 status-removed);不含人工 dropped
|
||||
VISIBLE_STATUSES = ("active", "unfaved", "removed")
|
||||
VIDEO_SORTS = {
|
||||
"heat", "view", "like", "coin", "favorite", "share", "reply", "danmaku",
|
||||
"interaction", "growth", "growth_rate", "added", "published",
|
||||
@@ -955,6 +957,7 @@ class DashboardQueries:
|
||||
within_start = _date_minus(latest, int(within_days) - 1)
|
||||
videos = self._videos(
|
||||
conn,
|
||||
statuses=VISIBLE_STATUSES,
|
||||
folder_id=folder_id,
|
||||
q=q,
|
||||
within_field=within_field,
|
||||
@@ -1157,7 +1160,7 @@ class DashboardQueries:
|
||||
aid = int(aid)
|
||||
|
||||
def run(conn: sqlite3.Connection) -> dict[str, Any] | None:
|
||||
video_rows = self._videos(conn)
|
||||
video_rows = self._videos(conn, statuses=VISIBLE_STATUSES)
|
||||
video = next((item for item in video_rows if int(item["aid"]) == aid), None)
|
||||
if video is None:
|
||||
row = conn.execute(
|
||||
|
||||
Reference in new issue
Block a user