Merge branch 'qb1'
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
commit
8e47d8715b
36 files changed
+2053
-89
No files matched your search
@@ -189,6 +189,8 @@ export const DownloadTask = EntityBase.extend({
|
||||
infohashV2: z.string().nullable(),
|
||||
acquisitionPlanId: Id.nullable(),
|
||||
sourceReleaseId: Id.nullable(),
|
||||
/** 关联作品:计划 / 站点资源 / 接管任务按文件名识别 / 手动指定 / 手动整理后回填(QB-1) */
|
||||
mediaEntityId: Id.nullable().optional(),
|
||||
name: z.string(),
|
||||
savePath: z.string().nullable(),
|
||||
contentPath: z.string().nullable(),
|
||||
|
||||
@@ -50,6 +50,13 @@ const Credential = z.string().min(1).max(4096);
|
||||
export const DownloaderKind = z.enum(["qbittorrent"]);
|
||||
export type DownloaderKind = z.infer<typeof DownloaderKind>;
|
||||
|
||||
/**
|
||||
* 下载器认证方式(存 settings.authKind):password 账密登录(凭证=密码);api_key qB 5.2+ WebUI 生成的 API Key
|
||||
* (凭证=Key,走 Authorization: Bearer,不登录);none 无认证(qB 对内网白名单跳过认证)。
|
||||
*/
|
||||
export const DownloaderAuthKind = z.enum(["password", "api_key", "none"]);
|
||||
export type DownloaderAuthKind = z.infer<typeof DownloaderAuthKind>;
|
||||
|
||||
export const DownloaderInstance = EntityBase.extend({
|
||||
name: z.string().min(1),
|
||||
kind: DownloaderKind,
|
||||
@@ -78,7 +85,11 @@ export const DownloaderInstanceCreate = DownloaderInstance.pick({
|
||||
settings: true,
|
||||
})
|
||||
.partial({ kind: true, username: true, managedTag: true, cacheVolumeKey: true, enabled: true, settings: true })
|
||||
.extend({ credential: Credential.optional() });
|
||||
.extend({
|
||||
credential: Credential.optional(),
|
||||
/** 认证方式,写入 settings.authKind;缺省按"有用户名 → 账密,否则有凭证 → API Key,否则无认证"推断 */
|
||||
authKind: DownloaderAuthKind.optional(),
|
||||
});
|
||||
export type DownloaderInstanceCreate = z.infer<typeof DownloaderInstanceCreate>;
|
||||
export const DownloaderInstanceUpdate = DownloaderInstanceCreate.partial();
|
||||
export type DownloaderInstanceUpdate = z.infer<typeof DownloaderInstanceUpdate>;
|
||||
|
||||
@@ -374,6 +374,27 @@ export const LibraryDetail = z.object({
|
||||
slots: z.array(AcquisitionSlot),
|
||||
candidates: z.array(CandidateEvaluation),
|
||||
downloads: z.array(LibraryDownloadView),
|
||||
/**
|
||||
* 该作品的整理记录(最近 100 条,新→旧):含没有下载任务的手动整理(文件管理按路径整理)。
|
||||
* 下载历史里已按下载任务列出的记录也在这里,前端按 downloadTaskId 去重展示。
|
||||
*/
|
||||
organizationRecords: z
|
||||
.array(
|
||||
z.object({
|
||||
id: Id,
|
||||
status: OrganizationStatus,
|
||||
action: OrganizationAction,
|
||||
trigger: OrganizationTrigger,
|
||||
downloadTaskId: Id.nullable(),
|
||||
sourcePath: z.string().nullable(),
|
||||
targetPath: z.string().nullable(),
|
||||
fileSucceeded: NonNegInt,
|
||||
fileTotal: NonNegInt,
|
||||
createdAt: Timestamp,
|
||||
finishedAt: Timestamp.nullable(),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
});
|
||||
export type LibraryDetail = z.infer<typeof LibraryDetail>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user