fix: 适配我喜欢的歌单获取,统一歌单列表渲染 - #34
Merged
Merged
Conversation
- 为歌单详情接口新增可选noCookie参数,支持动态控制 - 在获取我喜欢的歌单时关闭noCookie以正确获取数据 - 移除手机端单独的歌单渲染逻辑,统一使用SongList组件渲染 - 清理无用导入、方法和样式代码
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.
noCookie参数,支持动态控制请求是否携带登录态noCookie,确保私有歌单可正确获取详情与歌曲权限数据SongCard渲染逻辑,统一使用SongList虚拟列表组件渲染📌 变更类型
📝 变更说明
本次修复主要解决用户从首页进入“我喜欢的音乐”时出现卡顿、空白,以及刷新缓存时私有歌单详情请求返回
401 Unauthorized的问题。此前“我喜欢的音乐”页面在手机端使用单独的
SongCard分支渲染歌曲列表,会一次性渲染完整歌曲数据。当用户喜欢的歌曲数量较多,或页面正在刷新缓存时,容易造成 WebView 主线程压力过大,出现明显卡顿甚至页面空白。现在该页面统一使用已有的SongList虚拟列表组件,仅渲染可视区域内的歌曲项,从而降低首次进入和刷新缓存时的渲染压力。同时,歌单详情接口原先固定传入
noCookie: true,导致获取“我喜欢的音乐”这类私有歌单详情时不会携带登录态,在 Android 内置 API 链路下会触发401 Unauthorized。本次为playlistDetail新增可选noCookie参数,默认仍保持原有行为;仅在“我喜欢的音乐”页面显式关闭noCookie,使请求通过X-SPlayer-Cookie携带登录态,并由内置 API 转换为接口需要的标准 Cookie 请求。该调整保留了
SongList在手机端的单击播放能力,同时保留默认排序、非搜索状态下的拖拽排序能力,避免因性能修复引入播放交互回归。🔗 关联 Issue
Closes #33
📱 影响范围
✅ 自检清单
devpnpm lint且无 warningpnpm typecheck且无报错📸 截图 / 录屏 (UI 类 PR 必填)
401 Unauthorized🧪 测试方式
/playlist/detail的401 Unauthorized,缓存刷新后歌曲数量与内容正常。pnpm lint和pnpm typecheck,确认无 warning、无类型错误。💬 其他说明 (选填)
playlistDetail新增的noCookie参数默认值仍为true,其他调用方不受影响。X-SPlayer-Cookie仅用于前端到 SPlayer API 的本地/代理请求链路,不会以该自定义 Header 名称直接转发到服务器;其值会在 SPlayer API 层转换为接口需要的标准 Cookie。SongList后,手机端也会保留SongList的单击播放与长按拖拽排序能力。