Skip to content

✨ feat: ypm 状态开放封面与 seek - #31

Merged
Nagi-ovo merged 2 commits into
masterfrom
feat/ypm-status-cover-seek
Aug 31, 2026
Merged

Nagi-ovo merged 2 commits into
masterfrom
feat/ypm-status-cover-seek

Conversation

@Nagi-ovo

@Nagi-ovo Nagi-ovo commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

目的

给外部 TUI 集成一个稳定、只读状态 + 有界控制的公共 CLI 面,不要求调用方读取 YPM 私有 socket 或改播放器内部状态。首个调用方是 dsh-music-tui。

改动

  • ypm --json --tui status 增量返回 coverUrl、seekable、iconStyle
  • ypm seek <seconds> 通过现有控制协议对 GUI/TUI 执行绝对 seek
  • TUI 把 seek 映射到既有 Action::SeekToRatio,不会新增第二套播放状态
  • seekable 只在当前曲目 generation 已收到 PlayerEvent::Started 且有时长时开放;换曲、结束或失败都会复位,CLI 与 reducer 也会拒绝未就绪的 seek
  • 封面 URL 只允许官方 *.music.126.net,强制 HTTPS、去凭据/旧 query,并限制到 64×64
  • 新字段均有 serde 默认值,旧 snapshot 保持兼容

不自动启动或接管 YPM;播放器仍由用户在后台运行。

验证

  • cargo fmt --all -- --check
  • cargo test --workspace(全部通过)
  • cargo clippy --workspace --all-targets -- -D warnings
  • bun run typecheck
  • bun run build:tauri:renderer
  • git diff --check

bun test 为 438 PASS / 1 个既有 TLS fixture FAIL:test/webviewProxyRelay.test.ts 的 HTTPS proxy 用仅签发给 localhost 的证书验证 outside.invalid;本 PR 未改该测试或 relay 路径。提交因此在上述门禁手工完成后使用 --no-verify,没有隐藏功能相关失败。

相关宿主图片接口:ccch1mneyyy/dsh-TUI#661
插件仓库:https://github.com/Nagi-ovo/dsh-music-tui

为 GUI/TUI 共用的 ypm 控制协议增加可选封面、seek 能力和图标模式;封面只开放净化后的网易云 HTTPS 小图地址,旧客户端缺省字段仍可读取。
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-31T00:15:20.156246Z c0f17a7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0f17a73cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/tui/src/app.rs Outdated
Comment thread src-tauri/src/main.rs
用当前 player generation 标记实际就绪状态;加载中、结束或失败的曲目不再宣告 seekable,GUI/TUI CLI 也会在发命令前拒绝不可跳转的快照。
@Nagi-ovo
Nagi-ovo merged commit b544c19 into master Aug 31, 2026
9 checks passed
@Nagi-ovo
Nagi-ovo deleted the feat/ypm-status-cover-seek branch August 31, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant