copy(domain): 命名模板、规则判定、收录版本评估文案改全角标点并去掉内部用语
阶梯 pri / 候选 / 资产交付特征等改成界面用词;同步断言。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
12a8caa463
commit
0ba947dce3
14 files changed
+86
-80
No files matched your search
@@ -247,7 +247,7 @@ export function describeViolation(v: Violation): string {
|
||||
case "source.excluded":
|
||||
return `来源 ${a} 被排除`;
|
||||
case "source.not_encode":
|
||||
return `要求蓝光压制,实际 ${a}`;
|
||||
return `要求蓝光压制,实际 ${a}`;
|
||||
case "size.too_large":
|
||||
return `体积 ${fmtBytes(a)} 超过上限 ${fmtBytes(e)}`;
|
||||
case "size.too_small":
|
||||
@@ -257,7 +257,7 @@ export function describeViolation(v: Violation): string {
|
||||
case "size.unit_too_small":
|
||||
return `每集体积 ${fmtBytes(a)} 低于下限 ${fmtBytes(e)}`;
|
||||
case "subtitles.missing_language":
|
||||
return `缺少字幕 ${fmtList(e)}(实际 ${fmtList(a)})`;
|
||||
return `缺少字幕 ${fmtList(e)}(实际 ${fmtList(a)})`;
|
||||
case "cut.not_allowed":
|
||||
return `版本 ${a} 不在允许列表 ${fmtList(e)}`;
|
||||
case "group.excluded":
|
||||
@@ -265,11 +265,11 @@ export function describeViolation(v: Violation): string {
|
||||
case "contentType.not_allowed":
|
||||
return `内容类型 ${a} 不在允许列表 ${fmtList(e)}`;
|
||||
case "hdr.missing_required":
|
||||
return `HDR 需含 ${fmtList(e)} 之一(实际 ${fmtList(a)})`;
|
||||
return `HDR 需含 ${fmtList(e)} 之一(实际 ${fmtList(a)})`;
|
||||
case "hdr.excluded":
|
||||
return `HDR ${fmtList(a)} 被排除`;
|
||||
case "hdr.not_sdr":
|
||||
return `要求 SDR,实际带 ${fmtList(a)}`;
|
||||
return `要求 SDR,实际带 ${fmtList(a)}`;
|
||||
case "codec.not_allowed":
|
||||
return `编码 ${a} 不在允许列表 ${fmtList(e)}`;
|
||||
case "codec.excluded":
|
||||
@@ -287,35 +287,35 @@ export function describeViolation(v: Violation): string {
|
||||
case "seeders.too_few":
|
||||
return `做种数 ${a} 小于 ${e}`;
|
||||
case "promotion.not_free":
|
||||
return `非免费(下载系数 ${a})`;
|
||||
return `非免费(下载系数 ${a})`;
|
||||
case "tier.no_tier_matched":
|
||||
return "不命中优先级阶梯的任何一层";
|
||||
return "不符合优先级规则的任何一层";
|
||||
case "rule.hard_exclude":
|
||||
return `命中规则组「${e}」的硬排除 ${fmtList(a)}`;
|
||||
case "rule.no_layer_matched":
|
||||
return `不命中规则组「${e}」的任何一层`;
|
||||
case "upgrade.upgrade_disabled":
|
||||
return "已有版本且未开启升级";
|
||||
return "已有版本,且没开启升级";
|
||||
case "upgrade.at_ceiling":
|
||||
return "当前版本已达顶档,不再升级";
|
||||
return "现有版本已到封顶等级,不再升级";
|
||||
case "upgrade.same_tier":
|
||||
return "与当前版本同档,不反复更换";
|
||||
return "与现有版本同等级,不来回替换";
|
||||
case "upgrade.lower_tier":
|
||||
return "低于当前版本";
|
||||
return "比现有版本差";
|
||||
case "upgrade.below_min_improvement":
|
||||
return "提升幅度不足最小改进阈值";
|
||||
return "提升幅度不到最小升级幅度";
|
||||
case "upgrade.encode_not_qualified":
|
||||
return `压制组 ${a ?? "未知"} 不在合格名单`;
|
||||
case "upgrade.not_higher_priority":
|
||||
return `阶梯 pri 未严格提升(当前 ${JSON.stringify(e)},候选 ${JSON.stringify(a)})`;
|
||||
return `优先级没有提高(现有 ${JSON.stringify(e)},这个资源 ${JSON.stringify(a)})`;
|
||||
case "upgrade.not_full_pack":
|
||||
return "全集洗版只接受整季包";
|
||||
case "upgrade.no_improvable_units":
|
||||
return "候选所含单元都没有可提升的";
|
||||
return "这个资源包含的季集都没有可升级的";
|
||||
default:
|
||||
return e === undefined
|
||||
? `${v.field}: ${v.code}`
|
||||
: `${v.field}: ${v.code}(期望 ${JSON.stringify(e)},实际 ${JSON.stringify(a ?? null)})`;
|
||||
: `${v.field}: ${v.code}(期望 ${JSON.stringify(e)},实际 ${JSON.stringify(a ?? null)})`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ export function priorityLadder(spec: SlotSpec, r: ParsedRelease, ctx: Evaluation
|
||||
const name = t.name ?? `第${k + 1}层`;
|
||||
const fail = tierFailures(t, r, ctx);
|
||||
if (fail.length === 0) {
|
||||
trace.push(`${name}:命中,pri=${100 - k}`);
|
||||
trace.push(`${name}:命中,pri=${100 - k}`);
|
||||
return { pri: 100 - k, level: k, levelName: name, trace };
|
||||
}
|
||||
trace.push(`${name}:${fail.join(";")}`);
|
||||
@@ -480,7 +480,7 @@ export function evaluateCandidate(
|
||||
...withRules,
|
||||
};
|
||||
if (missing.length > 0)
|
||||
return { decision: "unknown_field", missing, trace: missing.map((f) => `字段未知,需要补充:${f}`) };
|
||||
return { decision: "unknown_field", missing, trace: missing.map((f) => `字段未知,需要补充:${f}`) };
|
||||
if (spec.soft?.tiers?.length && spec.soft.tiersRequired && ladder.level === null) {
|
||||
const v: Violation = { field: "tier", code: "no_tier_matched" };
|
||||
return {
|
||||
@@ -545,8 +545,7 @@ export function evaluateCandidate(
|
||||
...withRules,
|
||||
};
|
||||
}
|
||||
if (!current.source)
|
||||
return { decision: "unknown_field", missing: ["current_asset"], trace: ["当前资产交付特征未知"] };
|
||||
if (!current.source) return { decision: "unknown_field", missing: ["current_asset"], trace: ["现有文件的规格未知"] };
|
||||
const from = qualityTier(current, spec);
|
||||
if (up.ceilingTier !== undefined && from.source >= up.ceilingTier)
|
||||
return reject({ field: "upgrade", code: "at_ceiling", expected: up.ceilingTier, actual: from.source });
|
||||
|
||||
Reference in new issue
Block a user