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
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
type AcquisitionSlot,
|
||||
Api,
|
||||
DEFAULT_SEARCH_INTERVAL_HOURS,
|
||||
type SlotTemplate,
|
||||
type Subscription,
|
||||
type SubscriptionGroup,
|
||||
@@ -181,7 +182,7 @@ function overviewItem(row: SubscriptionRow & { media_entity_title?: string | nul
|
||||
missing: primary?.missing ?? 0,
|
||||
slots,
|
||||
lastUpdatedAt: lastUpdatedOf(m).toISOString(),
|
||||
searchEnabled: p.searchIntervalHours !== 0,
|
||||
searchEnabled: (p.searchIntervalHours ?? DEFAULT_SEARCH_INTERVAL_HOURS) > 0,
|
||||
sites: [] as { id: string; name: string }[],
|
||||
ruleGroups: [] as { id: string; name: string }[],
|
||||
defaultRuleGroups: m.defaultRuleGroups,
|
||||
@@ -477,7 +478,7 @@ export function registerSubscriptionRoutes(app: ModuleApp, d: AoDeps) {
|
||||
extra: { nextSearchNow?: boolean } = {},
|
||||
) => {
|
||||
const now = d.ports.now();
|
||||
const searchOn = subParams(sub).searchIntervalHours !== 0;
|
||||
const searchOn = (subParams(sub).searchIntervalHours ?? DEFAULT_SEARCH_INTERVAL_HOURS) > 0;
|
||||
const r = await db()
|
||||
.updateTable("subscription")
|
||||
.set({
|
||||
|
||||
@@ -85,7 +85,7 @@ const segOf = (u: { segment: string } | undefined) =>
|
||||
const editionKey = (e: string) => `edition:${e}`;
|
||||
const ymd = (d: Date) => d.toISOString().slice(0, 10);
|
||||
|
||||
/** 订阅有效自动补全:params.autoFill → 规则链上后者优先的 auto_fill → 系统缺省开 */
|
||||
/** 订阅有效自动补全:params.autoFill → 规则链上后者优先的 auto_fill → 系统缺省关 */
|
||||
export function subscriptionAutoFill(
|
||||
cat: RuleCatalog,
|
||||
sub: Pick<SubscriptionRow, "id" | "params" | "media_kind" | "media_entity_id">,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { DEFAULT_SEARCH_INTERVAL_HOURS } from "@umt/contracts";
|
||||
import { defineTask, type OutboxRouteFn, type TaskRegistry } from "@umt/tasks";
|
||||
import { z } from "zod";
|
||||
import type { SourcesRuntime } from "./runtime.ts";
|
||||
@@ -123,8 +124,8 @@ export function registerSourcesTasks(registry: TaskRegistry, rt: () => SourcesRu
|
||||
|
||||
// ── 订阅主动搜索(W5-C,对照 MP SubscribeSearchOwner):按作品标题/原名/别名在已开启站点搜索 ──
|
||||
|
||||
/** 主动搜索周期缺省 24h;subscription.params.searchIntervalHours 覆盖(0 = 关闭周期搜索) */
|
||||
export const DEFAULT_SEARCH_INTERVAL_HOURS = 24;
|
||||
/** 周期主动搜索缺省值见 contracts DEFAULT_SEARCH_INTERVAL_HOURS(0 = 关);新建与手动搜索照常各搜一次 */
|
||||
export { DEFAULT_SEARCH_INTERVAL_HOURS };
|
||||
/** 每次最多用几个检索词(标题、原名、别名),控制站点请求量 */
|
||||
export const SEARCH_MAX_KEYWORDS = 3;
|
||||
|
||||
|
||||
Reference in new issue
Block a user