feat(settings): storage budgets and retention in settings UI, tmdbMaxSize default 5000 (INT-3)
- Automation section gets storage budget, retention and cache TTL cards bound to settings.storage - Metadata section drops deprecated cache.tmdbTtlHours / cache.emptyResultTtlSec / identity.poolArchiveDays inputs - cache.tmdbMaxSize default 256 -> 5000; migration 0051 bumps stored values still at the old default Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0a8bfbb63e
commit
fe05138c9c
7 files changed
+119
-31
No files matched your search
@@ -102,27 +102,15 @@ function TmdbKeyStatus({ saved }: { saved: boolean }) {
|
||||
const TMDB_CACHE_CARD: CardSpec = {
|
||||
anchor: "tmdb-cache",
|
||||
title: "TMDB 缓存",
|
||||
description: "请求响应与识别结果存在数据库里,三个进程共用。超过条数上限时删最久未用的条目。",
|
||||
fields: [
|
||||
{ name: "cache.tmdbTtlHours", label: "有效期(小时)", kind: "number" },
|
||||
{ name: "cache.tmdbMaxSize", label: "条数上限", kind: "number", hint: "请求缓存和识别缓存各自计数" },
|
||||
{
|
||||
name: "cache.emptyResultTtlSec",
|
||||
label: "空结果有效期(秒)",
|
||||
kind: "number",
|
||||
hint: "搜索无结果、未识别时的短缓存",
|
||||
},
|
||||
],
|
||||
description:
|
||||
"请求响应与识别结果存在数据库里,三个进程共用。超过条数上限时删最久未用的条目;有效期在「自动化 → 存储与保留」里设。",
|
||||
fields: [{ name: "cache.tmdbMaxSize", label: "条数上限", kind: "number", hint: "请求缓存和识别缓存各自计数" }],
|
||||
fromSettings: (s) => ({
|
||||
"cache.tmdbTtlHours": n(s.cache.tmdbTtlHours),
|
||||
"cache.tmdbMaxSize": n(s.cache.tmdbMaxSize),
|
||||
"cache.emptyResultTtlSec": n(s.cache.emptyResultTtlSec),
|
||||
}),
|
||||
toPatch: (v) => ({
|
||||
cache: {
|
||||
tmdbTtlHours: Number(v["cache.tmdbTtlHours"]),
|
||||
tmdbMaxSize: Number(v["cache.tmdbMaxSize"]),
|
||||
emptyResultTtlSec: Number(v["cache.emptyResultTtlSec"]),
|
||||
},
|
||||
}),
|
||||
extra: () => <TmdbCacheStatus />,
|
||||
@@ -224,12 +212,6 @@ const IDENTITY_CARD: CardSpec = {
|
||||
hint: "旧行为。每条资源约 1–2 次搜索 + 命中时 1 次详情(识别缓存命中为 0);每小时 100 条的 RSS 约每天 2400–7200 次请求,站点独有的短剧 / 综艺多半查不到",
|
||||
wide: true,
|
||||
},
|
||||
{
|
||||
name: "identity.poolArchiveDays",
|
||||
label: "待识别池归档(天)",
|
||||
kind: "number",
|
||||
hint: "未命中订阅的条目超过这么多天没有新证据就归档,仍可筛出并手动指定",
|
||||
},
|
||||
{
|
||||
name: "identity.autoEnrich",
|
||||
label: "TMDB 查不到时自动补全元数据",
|
||||
@@ -253,7 +235,6 @@ const IDENTITY_CARD: CardSpec = {
|
||||
],
|
||||
fromSettings: (s) => ({
|
||||
"identity.eagerTmdbLookup": s.identity.eagerTmdbLookup,
|
||||
"identity.poolArchiveDays": n(s.identity.poolArchiveDays),
|
||||
"identity.autoEnrich": s.identity.autoEnrich,
|
||||
"identity.enrichDailyBudget": n(s.identity.enrichDailyBudget),
|
||||
"identity.enrichDomains": s.identity.enrichDomains.join("\n"),
|
||||
@@ -261,7 +242,6 @@ const IDENTITY_CARD: CardSpec = {
|
||||
toPatch: (v) => ({
|
||||
identity: {
|
||||
eagerTmdbLookup: v["identity.eagerTmdbLookup"] === true,
|
||||
poolArchiveDays: Number(v["identity.poolArchiveDays"]),
|
||||
autoEnrich: v["identity.autoEnrich"] === true,
|
||||
enrichDailyBudget: Number(v["identity.enrichDailyBudget"]),
|
||||
enrichDomains: String(v["identity.enrichDomains"] ?? "")
|
||||
|
||||
Reference in new issue
Block a user