Conversation
- siteMapping: IYUU 104 站 ↔ 本地站点 id 全量映射(84 同名 + 20 差异,实测对账)与 iyuuSiteToLocal()
- template: download_page 模板渲染({} → torrent_id + 静态凭据变量替换);{sign}/{cuhash} 等动态变量模板侧不实现,标记 unsupported
- resolver: 双路线解析 B(本地适配器 getTorrentDownloadRequestConfig,stub 构造)优先 / A(模板渲染)兜底;缺失/不支持变量收集供跳过与引导补配置
- types: IYUUSite/IYUUReseedHit/IYUUDownloadCredentials(凭据仅含静态可配置项)
- 验证:pnpm check + tsx 脚本 24 断言全过(映射/渲染/双路线/unsupported)
- storage: 新增 iyuu 键(token/heldSites/sidSha1+7天过期/站点表缓存 TTL 24h;token 不进备份) - messages 协议: getIyuusConfig/setIyuusConfig/iyuuFetchSites/iyuuReportExisting/iyuuQueryReseed/iyuuDeriveHeldSites - offscreen/utils/iyuu.ts: 中心三接口封装(axios,Token 头)+ sid_sha1 过期自动重汇报 + 持有站点自动推导(metadata.sites ∩ 104 站) - nativeMessaging 白名单登记 6 条;offscreen 注册 - 设置页: SetBase 新增「IYUU 辅种」窗口(token 配置、拉取站点表、推导/编辑持有站、汇报拿 sid_sha1);zh_CN/en 词条 - 验证: pnpm check + build:dist 通过(prettier 后复查)
- IMetadataPiniaStorageSchema 新增 iyuu? 字段(IIyuuSiteCacheEntry/IIyuuStorageSchema 定义移入 metadata.ts,删除独立 storages/iyuu.ts)
- storage.ts 移除独立 iyuu 键;offscreen 读写改为 metadata 子对象(读最新→补丁→整体合并写回,避免覆盖其他字段)
- options metadata store state 补 iyuu: {} 默认值(persistWebExt 整体持久化时不丢 offscreen 写入)
- 注意:media 备份(BackupFields.metadata)将包含 iyuu.token,与既有 cookie 备份先例一致
…get is not a function
- 新增 @ptd/crossSeed:类型(ICrossSeedCandidate/带 source)、模板渲染与双路线下载解析 (自 @ptd/iyuu 迁入并泛化:localSiteId 注入解耦)、pieces_hash 计算(sha1(info.pieces))、 nexusphp 源(POST /api/pieces-hash 直查,≤100/批)、local 源(文件布局/pieces 比对算法) - @ptd/iyuu 迁移后保持 re-export 兼容;候选类型全链切换 ICrossSeedCandidate - offscreen 新增 crossSeed.ts 聚合层(crossSeedScanForReseed:IYUU+Nexus 按配置启用、源级失败隔离) + 协议/白名单 +1 - 设置页新增 NexusPHP pieces-hash 直查配置(metadata.iyuu.nexusSites:apiUrl/passkey/enabled) - verify-crossseed.mts 17 项断言通过;dev.nexusphp.org 接口 401 属示例 passkey 预期(路由存在)
…+文件树决策闭环 - @ptd/crossSeed/local.ts 参照 decide.ts:TLocalMatchDecision、assessLocalCandidate(hash 去重 → fuzzySize → pieces_hash 强化 → strict/flexible/partial 文件树决策)、compareFileTreesIgnoringNames/Partial、fuzzySizeDoesMatch、normalizeClientFiles(绝对路径→种子相对根) - offscreen scanLocalSource 落地真实管线:下载器已完成种子文件树 → 目标站 getSearchResult 同名候选 → fuzzySize 预过滤 → getRemoteTorrentFile 抓 .torrent(站点 cookie)→ parse files/pieces_hash → 决策 → 命中构建候选(B 路线);searchLimit 风控 + 串行 - storage:metadata.iyuu 增 localSites/localMatchMode/localSearchLimit - 设置页 IYUU 卡新增「本地文件树对比(LocalCrossSeed)」:目标站勾选(自动保存)+ 匹配模式/搜索上限保存 - verify-local.mts 16 断言通过,verify-crossseed 回归通过
- 懒加载:iyuuResolveHits 与 crossSeed buildSourceCandidates 扫描阶段不再 getSiteInstance/resolver 预取详情页与下载链接,假定 IYUU/站点信息有效,候选直接 ready(site+torrentId);实际发送(downloadTorrent)时由站点适配器 B 路线构建链接,扫描更快 - 多选:候选 checkbox 按事件值显式设置/清除(非翻转),表头新增全选可辅种候选 - 一键推送(参照 iyuuplus-dev):ScanDialog 新增「推送辅种」——勾选候选直接 downloadTorrent 到所选下载器(savePath 复用来源目录,推送后自动取消勾选);「创建辅种任务」降为次要按钮保留 - 链路修正:所有注入侧(pushReseed/ReseedDialog/ReseedBatchDialog/keep-upload 任务发送)统一携带 torrent_id(item.id),供适配器构建真实下载链接;辅种任务 items 带 id - verify-crossseed/local 回归通过,pnpm check + build:dist 通过
- crossSeed 新增 siteMapping.ts(IYUU 站名↔本地站点映射 104 站,原 iyuu/siteMapping)与 iyuuCenter.ts(IYUUSite/IYUUReseedHit/IYUUReseedResponse 中心协议类型) - 删除 src/packages/iyuu 包(types/template/resolver 早已 re-export crossSeed) - 引用更新:messages.ts / offscreen/iyuu.ts / IyuuWindow.vue → @ptd/crossSeed - verify-p0 断言更新为新 resolver 签名(templateSite+localSiteId),三个 verify 全过;pnpm check + build:dist 通过
- 设置页:默认仅展示已添加站点中 schema 为 NexusPHP 的站点(getDefinedSiteMetadata),按钮「添加额外可能支持的站点」展开全部;说明增加「部分 NexusPHP 站点因架构原因并不支持该功能」 - 接口地址:留空时默认使用站点配置基址 + /api/pieces-hash(placeholder 展示),offscreen enabledNexusConfigs 从站点实例 url 拼接默认值 - locale zh/en 更新(nexusWarn/addExtra/hideExtra/rowsHint/noNexusSites)
- 新增 NexusSiteDialog.vue:站点下拉 + 接口地址(留空默认 基址+/api/pieces-hash,切换站点自动带出)+ passkey;保存时调 nexusValidateApi 验证(非 HTTP 404 即视为可达),通过后合并写回 nexusSites(保留已有配置)并 emit saved - offscreen 新增 nexusVerifyApi + 协议 nexusValidateApi + 白名单 - IyuuWindow:drawer 按钮改为打开 Dialog;nexusRows = schema==NexusPHP 的已添加站 ∪ 已配置(enabled)的额外站(保存后刷新即见);移除 showAll toggle - locale zh/en:dialog/verify 词条;删 nexusHideExtra
- 卡片顺序:全局辅种配置 → 本地文件树对比(LocalCrossSeed)→ NexusPHP pieces-hash 直查 → IYUU - 基于特征码的索引工具 - 原「IYUU Token」「已持有站点」两卡并入 IYUU 卡(section 标题 + 分隔线) - config.reseed 新增 enableIyuus/enableNexus/enableLocal 三个开关(ReseedWindow 全局配置卡内,即改即存) - offscreen resolveSourceOptions 读取 config.reseed 开关决定启用哪些源(显式 options 可覆盖) - locale zh/en 补 sourcesTitle/iyuuCardTitle/enable* 词条
- 列表批量扫描(ReseedBatchDialog)与详情单查(ReseedDialog)表头新增「全选可辅种候选」复选框,行勾选按事件值显式设置/清除(原为翻转,交互不确定) - locale zh/en 新增 MyClient.iyuuScan.selectAll / MyClient.detail.reseedSelectAll
- IyuuCard 接入 configStore(enableLocal/enableNexus/enableIyuus):关闭的方案的配置卡整体隐藏 - 三源全关时显示提示(sourcesDisabledHint) - locale zh/en 补 sourcesDisabledHint,69 键校验通过
- 启用复选框:passkey 为空时禁用并悬停提示(nexusEnabledRequiresPasskey) - locale zh/en 补词条,70 键校验通过
- awaitScanDialog 的 startScan 改用 crossSeedScanForReseed(按设置页辅种方案开关启用 IYUU/NexusPHP/Local 源),Local/Nexus 配置从此真正生效 - crossSeedScanForReseed 支持 hashes 子集(勾选场景预留) - 三处候选表(ScanDialog/ReseedBatchDialog/ReseedDialog)站点列新增来源徽标(common.source.iyuu/nexusphp/local) - locale zh/en 补 common.source.*,70 键校验通过
- 新增 crossSeedScanTorrents 聚合消息:输入指定种子集合(可跨下载器),按辅种方案开关执行 IYUU/NexusPHP/Local 源 - scanLocalSource 重构为 seeds+instanceFor 驱动(按种子的 clientId 取下载器实例取文件树),单下载器路径同步适配 - ICrossSeedLocalSeed 增加 clientId 字段 - ReseedBatchDialog(勾选批量)与 ReseedDialog(详情单查)从单源 iyuuQueryReseed 切到聚合消息 - 白名单 +crossSeedScanTorrents
- IndexedDB v4 新增 reseed_decision store(key=<siteId>:<torrentId>,decision: injected/matched);offscreen 提供 reseedDecisionRecord 消息 + 白名单 - 两个聚合入口(crossSeedScanForReseed/crossSeedScanTorrents)结果 finalize:按 site+torrentId 跨源去重,并依据 decision 标注 injected - ICrossSeedCandidate 增 progress(partial 预计并入进度,LocalCrossSeed 命中传 decision.progress)与 injected - UI 三对话框:状态列新增「已推送」灰色徽标与 partial 百分比琥珀徽标;推送/注入循环跳过已推送候选并在成功后写 decision(跨扫描不再重复注入) - 搜索页确有既有辅种检测入口(ActionTd → KeepUploadDialog),P1「搜索页按钮」由该承载 - locale zh/en 补 statusInjected/statusPartial/injectSkipped 等,70 键校验通过
- /keep-upload-task 与 /my-client 批量扫描按钮/对话框标题:IYUU 批量扫描 → 批量辅种扫描(en Batch Reseed Scan) - 详情单查对话框标题同步去 IYUU 化:其他站辅种(en Reseed on other sites)
- NexusPHP.getTorrentDownloadLink:站点配置了 detail.selectors.link 时(如 hdsky),无 link 场景 (IYUU 懒加载等)优先由 AbstractBittorrentSite 从详情页提取真实下载链接(带 passkey/sign), 提取到带凭据链接即返回,失败回退原裸拼;对未配置详情 link 选择器的 NPHP 站行为不变 - siteMapping:IYUU 的 dmhy 实为 U2 私站(u2.dmhy.org),从同名站移除并改映射 dmhy→u2 (同名 84→83、差异 20→21,总数 104 保持) - verify-p0 断言同步(dmhy→u2),check+build 通过
…过后续 set labels/uploadLimit - AddTorrentResponse 补充可选 torrent-duplicate(id/hashString/name) - addTorrent:torrent-added 与 torrent-duplicate 均可接受;duplicate 时 success 按 result==='success'(示例 result:success), 但不再执行 torrent-set labels 与 uploadLimit 等附加配置;两者都缺失时返回失败
- 无 link 时统一进入生成流程:有 id 且站点配置了 detail.selectors.link → 先由基类从详情页提取带凭据链接(hdsky 场景,避免裸拼缺 passkey/sign);提取失败/无选择器 → 回退原有 (url->)id 裸拼 - url 用 ??= 补全,消除重复分支,行为一致
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
将辅种(reseed)能力从「单源 IYUU」扩展为统一的多源辅种抽象,并补齐配套设置页与去重/信息展示。分支来自 fork(
feat/iyuu-reseed,基于 master)。主要内容
新包
@ptd/crossSeed(原 @ptd/iyuu 并入)ICrossSeedCandidate(含 source / progress / injected)三源聚合(offscreen)
crossSeedScanForReseed(单下载器)/crossSeedScanTorrents(指定种子集合,可跨下载器)UI
修复
备注
跨 fork draft PR,欢迎 review;如需,后续可拆分为更小的提交再逐部分合入。