fix(mediasource): web 源单集作品因集号解析失败而搜不到资源 - #3345
Open
GrahamZen wants to merge 1 commit into
Open
Conversation
GrahamZen
force-pushed
the
fix/selector-single-episode-sort
branch
from
August 25, 2026 16:56
aa74d59 to
482421b
Compare
单集作品 (OVA / 剧场版 / 单卷) 的条目页往往只有一集, 且标题就是作品名不含集号, 序号只能回落成整个标题, 与 Bangumi 侧的 01 永远不等. 数据源开启 filterByEpisodeSort 时这类资源会被全部过滤掉, 表现为"网站上找得到, 播放器里搜不到", 且连"已被排除的 资源"里都看不到 —— media 根本没生成. 已有的兜底 convertSpecialEpisodes() 只在 isPossiblyMovie() 成立时记 01, 而后者仅认 标题等于「正片」「高清版」或含 1080P/720P/4K 字样的, 覆盖不到按作品名命名的条目. 改为: 整个条目只解析出一集、且序号不是正常数字时, 记为第 1 集. 收窄到 singleOrNull() 是刻意的 —— 搜索结果里常有 playlist 塞着几十条无关内容的条目, 那些多集条目原样返回, 仍由 filterByEpisodeSort 正常挡掉. 顺带也救了序号为 null 的单集: 以前它们在 selectMedia 里就被丢弃, 连进列表的机会都没有. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GrahamZen
force-pushed
the
fix/selector-single-episode-sort
branch
from
August 25, 2026 17:13
482421b to
d3c02d9
Compare
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.
问题
单集作品(OVA / 剧场版 / 单卷)在 web 数据源上「网站里找得到,播放器里搜不到」,而且连「已被排除的资源」列表里都看不到 —— media 根本没生成。
这类条目页往往只有一集,标题就是作品名、不含集号,于是
SelectorMediaSource解析出的序号回落成整个标题,与 Bangumi 侧的01永远不相等。数据源开启filterByEpisodeSort时,这类资源会被全部过滤掉。已有的兜底
convertSpecialEpisodes()只在isPossiblyMovie()成立时记01,而后者仅认标题等于「正片」「高清版」或含1080P/720P/4K字样的,覆盖不到按作品名命名的条目。全平台一致。
改动
整个条目只解析出一集、且序号不是正常数字时,记为第 1 集。
收窄到
singleOrNull()是刻意的:搜索结果里常有 playlist 塞着几十条无关内容的条目,那些多集条目原样返回,仍由filterByEpisodeSort正常挡掉。顺带也救了序号为
null的单集 —— 以前它们在selectMedia里就被丢弃,连进列表的机会都没有。验证
本改动 cherry-pick 到当前
main后:app:android:compileDefaultDebugKotlin通过。🤖 Generated with Claude Code