feat(subscriptions): 按 MP 收敛订阅默认值与表单
- 定时主动搜索默认关(DEFAULT_SEARCH_INTERVAL_HOURS = 0),新建 / 手动照常各搜一次,之后靠 RSS 与站点快照 - 多版本自动补全系统缺省改为关 - 表单:基础页 = 作品与范围、下载、洗版;收录版本、优先级、自动补全折叠到进阶页「多版本」 - 对照文档 §7.3 记录落实范围 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
709414778e
commit
ed083fd138
12 files changed
+111
-74
No files matched your search
@@ -50,7 +50,13 @@ describe.skipIf(!hasPg)("订阅增强(真实 PG + mock qB + 临时目录)", () =
|
||||
|
||||
async function seriesSlot(
|
||||
title: string,
|
||||
opts: { mode?: "once" | "continuous"; status?: "active" | "pending"; hard?: object; upgrade?: object } = {},
|
||||
opts: {
|
||||
mode?: "once" | "continuous";
|
||||
status?: "active" | "pending";
|
||||
hard?: object;
|
||||
upgrade?: object;
|
||||
params?: object;
|
||||
} = {},
|
||||
) {
|
||||
const entityId = await seedEntity(h.db, { kind: "series", title, year: 2024 });
|
||||
const sub = await db()
|
||||
@@ -60,6 +66,7 @@ describe.skipIf(!hasPg)("订阅增强(真实 PG + mock qB + 临时目录)", () =
|
||||
media_kind: "series",
|
||||
mode: opts.mode ?? "continuous",
|
||||
status: opts.status ?? "active",
|
||||
...(opts.params ? { params: JSON.stringify(opts.params) } : {}),
|
||||
})
|
||||
.returning("id")
|
||||
.executeTakeFirstOrThrow();
|
||||
@@ -275,7 +282,7 @@ describe.skipIf(!hasPg)("订阅增强(真实 PG + mock qB + 临时目录)", () =
|
||||
}, 90_000);
|
||||
|
||||
it("多个目标版本按各自已接收单元完成,单版本入库不提前完成订阅", async () => {
|
||||
const { entityId, subId } = await seriesSlot("双版本剧", { mode: "once" });
|
||||
const { entityId, subId } = await seriesSlot("双版本剧", { mode: "once", params: { autoFill: "on" } });
|
||||
await db()
|
||||
.insertInto("acquisition_slot")
|
||||
.values({
|
||||
|
||||
@@ -55,7 +55,7 @@ describe.skipIf(!up)("订阅主动搜索与季总集数", () => {
|
||||
|
||||
it("按标题在已开启站点搜索:结果 upsert 为 source_release(新结果发 release.observed),排下次搜索并入队订阅重评", async () => {
|
||||
const e = await entity("Dune");
|
||||
const subId = await subscribe(e);
|
||||
const subId = await subscribe(e, { params: JSON.stringify({ searchIntervalHours: 24 }) });
|
||||
const searches = () => mock.requests.filter((r) => r.path.includes("search=")).length;
|
||||
const before = searches();
|
||||
const r = await searchSubscription(h.rt, subId);
|
||||
|
||||
@@ -86,7 +86,7 @@ describe("coverageRow", () => {
|
||||
});
|
||||
|
||||
describe("自动补全开关与补全预算", () => {
|
||||
it("订阅显式值优先;inherit 取规则链上最后一个设了 autoFill 的组;都没设为开", () => {
|
||||
it("订阅显式值优先;inherit 取规则链上最后一个设了 autoFill 的组;都没设为关(MP 没有多版本补全)", () => {
|
||||
expect(resolveAutoFill("off", [{ id: "g", autoFill: true }])).toMatchObject({
|
||||
enabled: false,
|
||||
source: "subscription",
|
||||
@@ -99,7 +99,7 @@ describe("自动补全开关与补全预算", () => {
|
||||
]),
|
||||
).toEqual({ enabled: false, mode: "inherit", source: "rule_group", ruleGroupId: "b" });
|
||||
expect(resolveAutoFill(undefined, [{ id: "a", autoFill: null }])).toEqual({
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
mode: "inherit",
|
||||
source: "default",
|
||||
});
|
||||
|
||||
@@ -309,7 +309,10 @@ describe.skipIf(!hasPg)("订阅重做(真实 PG)", () => {
|
||||
const e1 = await seedEntity(db(), { kind: "series", title: `${tag}甲`, year: 2025 });
|
||||
await season(e1, 1, 3);
|
||||
const e1u = await episode(e1, 1, 1);
|
||||
const s1 = await sub(e1, { lastProgressAt: new Date("2026-01-03T00:00:00Z"), params: { siteIds: [base.siteId] } });
|
||||
const s1 = await sub(e1, {
|
||||
lastProgressAt: new Date("2026-01-03T00:00:00Z"),
|
||||
params: { siteIds: [base.siteId], searchIntervalHours: 24 },
|
||||
});
|
||||
const s1p = await slot(e1, s1, "main");
|
||||
const a1 = await asset(e1);
|
||||
await cover(a1, [e1u]);
|
||||
@@ -349,7 +352,7 @@ describe.skipIf(!hasPg)("订阅重做(真实 PG)", () => {
|
||||
missing: 2,
|
||||
sites: [{ id: base.siteId, name: "测试站" }],
|
||||
defaultRuleGroups: true,
|
||||
autoFill: { enabled: true, mode: "inherit", source: "default" },
|
||||
autoFill: { enabled: false, mode: "inherit", source: "default" },
|
||||
searchEnabled: true,
|
||||
lastUpdatedAt: "2026-01-03T00:00:00.000Z",
|
||||
});
|
||||
@@ -391,7 +394,7 @@ describe.skipIf(!hasPg)("订阅重做(真实 PG)", () => {
|
||||
const e = await seedEntity(db(), { kind: "series", title: "Fill Show", year: 2025 });
|
||||
await season(e, 1, 10);
|
||||
const u1 = await episode(e, 1, 1);
|
||||
const s = await sub(e);
|
||||
const s = await sub(e, { params: { autoFill: "on" } });
|
||||
const p = await slot(e, s, "4K", { position: 0, hard: { resolutions: ["2160p"] } });
|
||||
const q = await slot(e, s, "1080p", { position: 1, hard: { resolutions: ["1080p"] } });
|
||||
const a = await asset(e, { quality: { resolution: "2160p", source: "REMUX" } });
|
||||
@@ -613,7 +616,7 @@ describe.skipIf(!hasPg)("订阅重做(真实 PG)", () => {
|
||||
|
||||
it("暂停 / 恢复 / 重新订阅 / 批量 / 收录版本排序", async () => {
|
||||
const e = await seedEntity(db(), { kind: "movie", title: "动作片", year: 2024 });
|
||||
const s = await sub(e, { kind: "movie", mode: "once" });
|
||||
const s = await sub(e, { kind: "movie", mode: "once", params: { searchIntervalHours: 24 } });
|
||||
const a = await slot(e, s, "A", { position: 0 });
|
||||
const b = await slot(e, s, "B", { position: 1 });
|
||||
|
||||
|
||||
Reference in new issue
Block a user