Repository navigation
分拣台:卡片显示 B站 分区,搜索能搜分区 - #461
Merged
Merged
Conversation
收藏夹的视频按 50 个一批补取 B站 分区(medialist/gateway/base/resource/infos 返回旧版 tid,静态表映射成大分区名),存进新键 triage_zones。卡片小字末尾显示分区名,搜索匹配分区名。分区不进筛选区:太粗,又是 UP 主自己选的。
PathGao
enabled auto-merge (squash)
November 11, 2026 07:10
PathGao
added a commit
that referenced
this pull request
Nov 11, 2026
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.
分拣台收藏夹的卡片小字末尾显示视频的 B站 分区,例如「CICI滕 · 2 天前 · ▶ 3.7万 · 舞蹈」,搜索框也能搜分区名。整理收藏夹时,光看标题拿不准的视频,看分区多半能定下来。
收藏列表接口不带分区,视频详情接口的 tname 现在是空的。改用
medialist/gateway/base/resource/infos:一次最多 50 个,返回旧版子分区 tid,用静态表映射成大分区名。表来自 App 的 region/index,旧版编号已冻结,所以运行时不再请求。打开或刷新收藏夹后,页面按 50 个一批补取,批间隔 1 秒,走 runs.js 的长任务循环,限流时复用现有的等待。换收藏夹后,晚到的回答丢掉。结果存进新键triage_zones({bvid: tid}),快照结构不变。番剧、已失效、没有 aid 的视频不请求。B站 没返回的视频记 0,以后不再请求。失败的批次本页不再重发。存储由页面在锁里写入,并滤掉本页清理过的视频,所以清理后才到的回答不会把它们写回去。分区不进第 4 行筛选区。试过灰色分区片:单纯快乐有 15 个分区,标签行折成两行;而且分区是 UP 主自己选的,「生活」什么都装,用来筛选意义不大。DESIGN.md 写明了这一点。
验证:
node scripts/selftest.mjs48 个通过,去掉清理后写回和失败重发的修复,对应的两条新测试会失败。无头 Chrome 用真实收藏夹数据测了 7 项:默认收藏夹 190 个和单纯快乐 710 个都补取完整,每批不超过 50 个;900 张卡片的小字逐张核对;换收藏夹不重复请求;补取中途换收藏夹会停下;控制台没有报错。之后在 ego 里重载扩展实测:单纯快乐 710 个约 20 秒取完,搜「舞蹈」得 398 个(393 个舞蹈区,5 个是标题含这个词),扩展没有运行时错误。没测:scripts/smoke.mjs。后续另做:补取和收藏夹刷新共用一个 B站 请求节流;AI 粗看时把分区一起发过去。