文案(订阅/发现/集数映射):在途改下载中、计划改下载,按钮写清动作
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
9c7ce109ea
commit
cfc9793dcd
11 files changed
+34
-34
No files matched your search
@@ -271,7 +271,7 @@ function ExploreResults({ s }: { s: ExploreState }) {
|
||||
if (!items.length)
|
||||
return (
|
||||
<EmptyState
|
||||
title={s.list === "search" ? "没有搜到作品" : "没有条目"}
|
||||
title={s.list === "search" ? "没有搜到作品" : "没有作品"}
|
||||
description={s.list === "search" ? "换个关键词,或换个来源再搜。" : "换个列表或放宽筛选条件。"}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ function Section({ section, actions }: { section: RecommendSection; actions: Ret
|
||||
</div>
|
||||
) : q.isSuccess && items.length === 0 ? (
|
||||
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-caption text-muted-foreground">
|
||||
这里暂时没有条目。
|
||||
这一栏暂时没有作品。
|
||||
</p>
|
||||
) : (
|
||||
<ul className="scroll-bleed flex gap-3 overflow-x-auto">
|
||||
|
||||
@@ -213,7 +213,7 @@ function IgnoreButton({ d, view }: { d: Decision; view: EpisodeDecisionView }) {
|
||||
.then(
|
||||
() => toast.success(withRule ? "已忽略,并建了忽略规则" : "已忽略"),
|
||||
(err) => {
|
||||
toast.error(errorMessage(err, "操作失败"));
|
||||
toast.error(errorMessage(err, "忽略失败"));
|
||||
throw err;
|
||||
},
|
||||
)
|
||||
@@ -269,12 +269,12 @@ export function EpisodeDecision({ d, open }: { d: Decision; open: boolean }) {
|
||||
trigger={
|
||||
<Button size="sm">
|
||||
<Bot />
|
||||
确认智能体建议
|
||||
采用智能体建议
|
||||
</Button>
|
||||
}
|
||||
title="按智能体建议的规则处理?"
|
||||
title="按智能体建议建规则?"
|
||||
description={`${view.confirmAgent.description ?? ""}。规则在作品页的集数映射里可以再改。`}
|
||||
confirmLabel="确认"
|
||||
confirmLabel="建规则并重算"
|
||||
onConfirm={() =>
|
||||
resolve.mutateAsync({ id: d.id, optionKey: view.confirmAgent!.key }).then(
|
||||
() => toast.success("已建规则并重算"),
|
||||
@@ -291,12 +291,12 @@ export function EpisodeDecision({ d, open }: { d: Decision; open: boolean }) {
|
||||
trigger={
|
||||
<Button size="sm" variant={view.confirmAgent && view.agentSuggestion ? "outline" : "default"}>
|
||||
<Check />
|
||||
确认
|
||||
采用建议规则
|
||||
</Button>
|
||||
}
|
||||
title="按建议规则处理?"
|
||||
title="按建议建规则?"
|
||||
description={`${view.confirm.description ?? ""}。规则在作品页的集数映射里可以再改。`}
|
||||
confirmLabel="确认"
|
||||
confirmLabel="建规则并重算"
|
||||
onConfirm={() =>
|
||||
resolve.mutateAsync({ id: d.id, optionKey: view.confirm!.key }).then(
|
||||
() => toast.success("已建规则并重算"),
|
||||
|
||||
@@ -32,7 +32,7 @@ export function SubscriptionMappingSummary({
|
||||
return (
|
||||
<Panel
|
||||
title="集数映射"
|
||||
description={`${season != null ? `第 ${season} 季` : "全部季"}最近资源按发布组的识别方式`}
|
||||
description={`按发布组列出${season != null ? `第 ${season} 季` : "全部季"}最近资源的集数识别方式`}
|
||||
actions={
|
||||
<Link
|
||||
to={mappingHref(consolePath("library", entityId))}
|
||||
|
||||
@@ -47,7 +47,7 @@ export function useSubscriptionOps() {
|
||||
reset: (id: string) =>
|
||||
reset.mutateAsync(id).then((r) => {
|
||||
const kept = r.keptPlans.length ? `,${r.keptPlans.length} 个仍在下载的保留` : "";
|
||||
toast.success(`已重置:释放 ${r.releasedPlans.length} 个计划${kept}`);
|
||||
toast.success(`已重置:取消 ${r.releasedPlans.length} 个下载${kept}`);
|
||||
}),
|
||||
remove: (ids: string[]) =>
|
||||
batch.mutateAsync({ ids, action: "delete" }).then((r) => {
|
||||
@@ -63,7 +63,7 @@ export function useSubscriptionOps() {
|
||||
const ok = r.results.filter((x) => x.ok).length;
|
||||
const label = { search: "开始搜索", pause: "暂停", resume: "恢复" }[a];
|
||||
if (ok === ids.length) toast.success(`${ok} 个订阅已${label}`);
|
||||
else toast.warning(`${ok}/${ids.length} 个已${label};${r.results.find((x) => !x.ok)?.error ?? ""}`);
|
||||
else toast.warning(`${ok}/${ids.length} 个已${label};${r.results.find((x) => !x.ok)?.error ?? ""}`);
|
||||
},
|
||||
onError: (e) => toast.error(errorMessage(e)),
|
||||
},
|
||||
@@ -186,7 +186,7 @@ export function SubscriptionMenu({
|
||||
open={confirmReset}
|
||||
onOpenChange={setConfirmReset}
|
||||
title="重置这个订阅的进度?"
|
||||
description="取消还没提交、或下载任务已不在的计划,清掉延后记录,然后重新评估。仍在下载的任务、已整理文件和总集数保留。"
|
||||
description="取消还没提交或下载任务已不在的下载,清掉延后记录,再重新评估。仍在下载的任务、已整理文件和总集数保留。"
|
||||
confirmLabel="重置"
|
||||
onConfirm={() =>
|
||||
ops.reset(sub.id).catch((e) => {
|
||||
|
||||
@@ -302,17 +302,17 @@ export function CellSheet({
|
||||
{
|
||||
label: "下载",
|
||||
value: c.planId
|
||||
? `${PLAN_STAGE[c.planStage ?? ""] ?? c.planStage ?? "在途"} · ${c.planId.slice(0, 8)}`
|
||||
? `${PLAN_STAGE[c.planStage ?? ""] ?? c.planStage ?? "下载中"} · ${c.planId.slice(0, 8)}`
|
||||
: null,
|
||||
},
|
||||
{ label: "原因", value: c.reason ? (SKIP_REASON[c.reason] ?? c.reason) : null },
|
||||
{ label: "延后", value: c.deferred ? "有资源在等待重评(预算或自动补全关闭)" : null },
|
||||
{ label: "延后", value: c.deferred ? "有资源等待重新评估(预算用完或自动补全已关)" : null },
|
||||
]}
|
||||
/>
|
||||
</DetailSection>
|
||||
{fillable ? (
|
||||
<p className="text-meta text-muted-foreground">
|
||||
手动补全不受自动补全开关和补全预算限制,仍受全局每日预算与缓存卷阈值约束。
|
||||
手动补全不受自动补全开关和补全预算限制,但仍受每日总预算和下载盘阈值限制。
|
||||
</p>
|
||||
) : null}
|
||||
{sel.row.slotId === null && c.state === "missing" ? (
|
||||
|
||||
@@ -59,9 +59,9 @@ describe("订阅总览文案", () => {
|
||||
expect(seasonLabel({ mediaKind: "series", seasonNumber: 1, seasonScope: "current_season" })).toBe("S1");
|
||||
expect(seasonLabel({ mediaKind: "movie", seasonNumber: null, seasonScope: "current_season" })).toBeNull();
|
||||
});
|
||||
it("版本徽标按 洗版 → 在途 → 缺 → 已齐 判定", () => {
|
||||
it("版本徽标按 洗版 → 下载中 → 缺 → 已齐 判定", () => {
|
||||
expect(slotBadge(slot({ upgrading: true, minPri: 97, targetPri: 100, missing: 2 })).label).toBe("洗版中 97→100");
|
||||
expect(slotBadge(slot({ inflight: 2, missing: 3 }))).toEqual({ label: "在途 2", tone: "neutral" });
|
||||
expect(slotBadge(slot({ inflight: 2, missing: 3 }))).toEqual({ label: "下载中 2", tone: "neutral" });
|
||||
expect(slotBadge(slot({ missing: 3 })).tone).toBe("destructive");
|
||||
expect(slotBadge(slot({ have: 10, total: 10 }))).toEqual({ label: "已齐", tone: "success" });
|
||||
expect(slotBadge(slot({})).label).toBe("未开始");
|
||||
|
||||
@@ -27,7 +27,7 @@ export const GROUP_LABEL: Record<SubscriptionGroup, string> = {
|
||||
following: "追更中",
|
||||
waiting: "待搜索",
|
||||
completed: "已完成",
|
||||
paused: "暂停",
|
||||
paused: "已暂停",
|
||||
pending: "待定",
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ export function slotBadge(s: SubscriptionSlotSummary): ToneLabel {
|
||||
label: s.minPri !== null && s.targetPri !== null ? `洗版中 ${s.minPri}→${s.targetPri}` : "洗版中",
|
||||
tone: "warning",
|
||||
};
|
||||
if (s.inflight > 0) return { label: `在途 ${s.inflight}`, tone: "neutral" };
|
||||
if (s.inflight > 0) return { label: `下载中 ${s.inflight}`, tone: "neutral" };
|
||||
if (s.missing > 0) return { label: `缺 ${s.missing}`, tone: "destructive" };
|
||||
if (s.total !== null && s.total > 0 && s.have >= s.total) return { label: "已齐", tone: "success" };
|
||||
return { label: s.have > 0 ? `已整理 ${s.have}` : "未开始", tone: "neutral" };
|
||||
@@ -79,11 +79,11 @@ export const AUTOFILL_LABEL: Record<AutoFillMode, string> = { inherit: "跟随
|
||||
export const AUTOFILL_SOURCE: Record<"subscription" | "rule_group" | "default", string> = {
|
||||
subscription: "订阅设置",
|
||||
rule_group: "规则组",
|
||||
default: "系统缺省",
|
||||
default: "系统默认",
|
||||
};
|
||||
|
||||
export function autoFillText(a: SubscriptionOverviewItem["autoFill"]): string {
|
||||
return `自动补全${a.enabled ? "开" : "关"}${a.mode === "inherit" ? `(${AUTOFILL_SOURCE[a.source]})` : ""}`;
|
||||
return `自动补全${a.enabled ? "开" : "关"}${a.mode === "inherit" ? `(${AUTOFILL_SOURCE[a.source]})` : ""}`;
|
||||
}
|
||||
|
||||
// ── 覆盖矩阵 ──
|
||||
@@ -123,7 +123,7 @@ export function cellKind(c: CoverageCell): CellKind {
|
||||
export const CELL_LABEL: Record<CellKind, string> = {
|
||||
have: "已整理",
|
||||
upgradable: "可升级",
|
||||
inflight: "在途",
|
||||
inflight: "下载中",
|
||||
deferred: "延后",
|
||||
missing: "缺失",
|
||||
suspected: "疑似缺失",
|
||||
@@ -131,12 +131,12 @@ export const CELL_LABEL: Record<CellKind, string> = {
|
||||
skipped: "不需要",
|
||||
};
|
||||
|
||||
export const PLAN_STAGE: Record<string, string> = { reserved: "已预留", downloading: "下载中", verifying: "核验中" };
|
||||
export const PLAN_STAGE: Record<string, string> = { reserved: "准备下载", downloading: "下载中", verifying: "核验中" };
|
||||
|
||||
export const SKIP_REASON: Record<string, string> = {
|
||||
out_of_range: "集范围外",
|
||||
not_aired: "未播出",
|
||||
not_required: "该收录版本不要求这个内容版本",
|
||||
not_required: "收录版本不要求这个内容版本",
|
||||
suspected: "总集数未知,按已见最高集推断",
|
||||
deferred: "有延后的资源",
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ export const itemTitle = (x: Item) => x.mediaEntityTitle ?? x.titleQuery ?? "未
|
||||
function Flags({ x }: { x: Item }) {
|
||||
return (
|
||||
<>
|
||||
{x.group === "paused" ? <StatusBadge tone="neutral">暂停</StatusBadge> : null}
|
||||
{x.group === "paused" ? <StatusBadge tone="neutral">已暂停</StatusBadge> : null}
|
||||
{x.group === "pending" ? (
|
||||
<StatusBadge tone="warning">{x.mediaEntityId ? "待定" : "不在媒体库"}</StatusBadge>
|
||||
) : null}
|
||||
@@ -45,7 +45,7 @@ export function ProgressBlock({ x, className }: { x: Pick<Item, "progress" | "mo
|
||||
<span className="font-medium text-foreground tabular-nums">
|
||||
{progressText(x.progress)}
|
||||
{x.progress.inflight > 0 ? (
|
||||
<span className="font-normal text-muted-foreground"> · 在途 {x.progress.inflight}</span>
|
||||
<span className="font-normal text-muted-foreground"> · 下载中 {x.progress.inflight}</span>
|
||||
) : null}
|
||||
</span>
|
||||
{unknown ? <span className="text-muted-foreground">持续追踪</span> : null}
|
||||
@@ -57,7 +57,7 @@ export function ProgressBlock({ x, className }: { x: Pick<Item, "progress" | "mo
|
||||
"bg-[repeating-linear-gradient(90deg,var(--color-foreground)_0_4px,transparent_4px_8px)] opacity-20",
|
||||
)}
|
||||
role="img"
|
||||
aria-label={`已整理 ${x.progress.have},在途 ${x.progress.inflight},总 ${x.progress.total ?? "未知"}`}
|
||||
aria-label={`已整理 ${x.progress.have},下载中 ${x.progress.inflight},总 ${x.progress.total ?? "未知"}`}
|
||||
>
|
||||
{unknown ? null : (
|
||||
<>
|
||||
|
||||
@@ -112,7 +112,7 @@ export function SlotPanel({
|
||||
<span className="flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 text-meta text-muted-foreground tabular-nums max-sm:w-full max-sm:pl-9">
|
||||
<span>已整理 {r.summary.have}</span>
|
||||
<span className={r.summary.missing ? "text-destructive" : undefined}>缺 {r.summary.missing}</span>
|
||||
<span>在途 {r.summary.inflight}</span>
|
||||
<span>下载中 {r.summary.inflight}</span>
|
||||
{i === 0 ? null : <span>{r.autoFill ? "自动补全" : "只登记缺失"}</span>}
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -461,7 +461,7 @@ export function SubscriptionFormDialog({
|
||||
<DialogHeader>
|
||||
<DialogTitle>{editing ? "编辑订阅" : "新建订阅"}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{editing ? titleText : initialTarget ? titleText : "从媒体库或 TMDB 选作品;选 TMDB 条目会先加入媒体库。"}
|
||||
{editing ? titleText : initialTarget ? titleText : "从媒体库或 TMDB 选作品;选 TMDB 上的作品会先加入媒体库。"}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
{dup ? (
|
||||
@@ -483,7 +483,7 @@ export function SubscriptionFormDialog({
|
||||
<Tabs value={tab} onValueChange={setTab} className="min-w-0">
|
||||
<TabsList>
|
||||
<TabsTrigger value="basic">基础</TabsTrigger>
|
||||
<TabsTrigger value="advanced">进阶</TabsTrigger>
|
||||
<TabsTrigger value="advanced">高级</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="basic" className="mt-4 min-w-0 space-y-5">
|
||||
@@ -504,7 +504,7 @@ export function SubscriptionFormDialog({
|
||||
{target.kind === "entity"
|
||||
? "媒体库作品"
|
||||
: target.kind === "tmdb"
|
||||
? "TMDB 条目,保存时加入媒体库"
|
||||
? "TMDB 作品,保存时加入媒体库"
|
||||
: (target.note ?? "按标题追踪,不在媒体库")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -871,7 +871,7 @@ export function SubscriptionFormDialog({
|
||||
id={f("tpl")}
|
||||
value={d.policyRevisionId}
|
||||
onChange={(v) => patch({ policyRevisionId: v })}
|
||||
placeholder={defaultTpl ? `按已发布收录策略(${defaultTpl.title})` : "按已发布收录策略"}
|
||||
placeholder={defaultTpl ? `按已发布收录策略(${defaultTpl.title})` : "按已发布收录策略"}
|
||||
options={templates.map((p) => ({
|
||||
value: p.id,
|
||||
label: `${p.title} r${p.revision}:${tplNames(p.id).join(" → ") || "无模板"}`,
|
||||
@@ -972,7 +972,7 @@ export function AutoFillFields({
|
||||
</FormField>
|
||||
</div>
|
||||
<p className="text-meta text-muted-foreground">
|
||||
预算只算自动补全的计划,超出的延到次日;同时受全局每日预算限制。
|
||||
预算只算自动补全发起的下载,超出的延到第二天;也受每日总预算限制。
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user