统一集数 URL 归一化#2264
Merged
Merged
Conversation
- 新增集数源站 URL 归一化工具 - 在线路生产端和播放消费端统一 URL 口径 - 增加 URL 归一化单元测试
6c18ea7 to
b407a43
Compare
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The URL normalization logic is sound and well-tested. Files Reviewed (4 files)
Reviewed by claude-4.8-opus-20260528 · Input: 4.1K · Output: 6.6K · Cached: 215.8K |
ErBWs
pushed a commit
to ErBWs/Kazumi
that referenced
this pull request
Jun 25, 2026
- 新增集数源站 URL 归一化工具 - 在线路生产端和播放消费端统一 URL 口径 - 增加 URL 归一化单元测试 (cherry picked from commit 65304d8)
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.
Cause
同一集的源站 URL 在播放、下载、历史回填等入口可能表现为相对路径、缺协议、
http/https不一致、尾斜杠不一致,或在端口、protocol-relative URL 形态上存在差异。后续以 URL 作为pageUrl主键匹配时,这些形态差异会导致同一集失配。Fix
normalizeEpisodeUrl,统一集数源站 URL 归一化口径。Plugin.querychapterRoads写入Road.data前归一化 URL。http -> https、显式端口保留、protocol-relative URL、尾斜杠、空白、空输入、query 保留和幂等性。Risk
当前归一化会把
http统一为https,并且归一化结果同时作为pageUrl身份 key 和实际请求 URL。项目既有章节页请求逻辑已经倾向将源站 URL 升级为https,因此本 PR 暂不拆分 key URL 与请求 URL。如果回归发现存在只支持http的源站,需要再调整设计。Tests
flutter test test/episode_url_test.dartflutter analyze --no-pub --no-fatal-infos --fatal-warnings(退出码 0;仓库现有 32 条 info 级提示)