feat: EOD 23:15 seal + midnight seed shell for video/fans
Move daily snapshot/fans to 23:15 and add 00:01 seed that clones last_completed ok=1 rows into today without advancing completed. Evening runs force through seed markers; growth previous is per-aid adjacent. Home shows short-update clock + 全站数据 date, and 收录视频 counts.
This commit is contained in:
1 parent
374b138041
commit
8a9cb21408
17 files changed
+520
-39
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { api } from "../api.js";
|
||||
import { emptyState, mediaCard } from "../components.js";
|
||||
import {
|
||||
escapeAttr, escapeHtml, formatCount, formatDelta,
|
||||
formatPercent, formatScore,
|
||||
escapeAttr, escapeHtml, formatClock, formatCount, formatDataDate,
|
||||
formatDelta, formatPercent, formatScore,
|
||||
} from "../format.js";
|
||||
import { canAccessProtected } from "../session.js";
|
||||
|
||||
@@ -55,6 +55,11 @@ export async function renderHome(root) {
|
||||
? formatCount(overview.initial_import_count)
|
||||
: formatCount(overview.added_today);
|
||||
const activeCount = overview.counts?.active || 0;
|
||||
const totalCount = overview.counts?.total
|
||||
?? ((overview.counts?.active || 0)
|
||||
+ (overview.counts?.unfaved || 0)
|
||||
+ (overview.counts?.removed || 0)
|
||||
+ (overview.counts?.dropped || 0));
|
||||
const pending = overview.counts?.candidates_pending || 0;
|
||||
// 候选提示仅对已登录(或未启用鉴权)用户可见,访客不展示运行期信息。
|
||||
const showCandidates = pending > 0 && canAccessProtected();
|
||||
@@ -66,12 +71,14 @@ export async function renderHome(root) {
|
||||
const growthEmptyHint = growthDays <= 1
|
||||
? "当前快照不足,完成至少 2 天快照后即可显示播放增量。"
|
||||
: `需要至少 ${growthDays + 1} 天快照才能计算近 ${growthDays} 日增长。`;
|
||||
const updatedLabel = formatClock(overview.updated_at);
|
||||
const dataDateLabel = formatDataDate(overview.data_date);
|
||||
|
||||
root.innerHTML = `<section class="page home-page">
|
||||
<header class="page-head home-head">
|
||||
<div>
|
||||
<h1>最新动态</h1>
|
||||
<p class="page-sub">收录视频 ${formatCount(activeCount)}</p>
|
||||
<p class="page-sub">更新:${escapeHtml(updatedLabel)} / 全站数据:${escapeHtml(dataDateLabel)}</p>
|
||||
</div>
|
||||
<button class="icon-button" id="refresh-home" type="button" title="刷新">刷新</button>
|
||||
</header>
|
||||
@@ -86,7 +93,7 @@ export async function renderHome(root) {
|
||||
${statChip("7 日粉丝变化", fans?.delta_7d === null || fans?.delta_7d === undefined ? "—" : formatDelta(fans.delta_7d), {
|
||||
href: "/fans",
|
||||
})}
|
||||
${statChip("数据日期", escapeHtml(overview.data_date || "—"))}
|
||||
${statChip("收录视频", `${formatCount(activeCount)} / ${formatCount(totalCount)}`)}
|
||||
</div>
|
||||
|
||||
${showCandidates ? `<a class="notice-row" href="/candidates">
|
||||
|
||||
Reference in new issue
Block a user