feat(netease): 添加网易云音乐听歌打卡功能#43
Open
laoshuikaixue wants to merge 5 commits into
Open
Conversation
laoshuikaixue
commented
Jun 20, 2026
- 集成 scrobble 模块实现听歌记录上报
- 添加网易云打卡服务处理播放状态和进度跟踪
- 实现播放时长计算和自动打卡逻辑
- 添加最低播放时长限制和最大等待时间控制
- 在播放状态变化、切歌、结束时触发相应打卡操作
- 添加专门的日志记录和错误处理机制
- 将 scrobble 接口加入非缓存列表确保实时性
- 扩展 .gitignore 忽略 IDE 配置文件
- 集成 scrobble 模块实现听歌记录上报 - 添加网易云打卡服务处理播放状态和进度跟踪 - 实现播放时长计算和自动打卡逻辑 - 添加最低播放时长限制和最大等待时间控制 - 在播放状态变化、切歌、结束时触发相应打卡操作 - 添加专门的日志记录和错误处理机制 - 将 scrobble 接口加入非缓存列表确保实时性 - 扩展 .gitignore 忽略 IDE 配置文件
Author
- 为配置文件添加 osx 平台配置信息 - 添加 macOS 专用 User-Agent 头部设置 - 在请求处理中根据设备类型动态选择合适的 User-Agent - 重构播放记录模块以支持异步处理 - 添加对 macOS 客户端日志接口的支持 - 修改 Cookie 处理逻辑以包含操作系统信息 - 分别发送开始播放和播放记录请求并合并响应结果
- 将cookie变量声明提前并统一处理对象和字符串类型的合并逻辑 - 使用Object.assign替代对象展开语法来合并cookie配置 - 简化条件判断逻辑,提高代码可读性 - 保持原有的os参数设置功能不变
Author
- 将 submitted 标志重命名为 attempted 以更准确反映状态 - 修复打卡提交条件判断逻辑,确保每次只提交一次 - 改进播放时间计算,在提交时使用实际播放时长而非歌曲总时长 - 确保在切换歌曲或清除当前曲目时正确重置打卡状态
- 引入loaded变量存储最近加载的可打卡曲目 - 添加cycleId用于标识播放轮次并防止旧请求回包 - 实现beginCycle和resetCycle函数管理播放状态周期 - 修改thresholdMs为独立函数计算打卡阈值 - 更新onPosition函数接收当前位置参数并优化倒带检测 - 在sourceError事件中添加打卡状态重置 - 改进暂停逻辑确保播放进度正确累积 - 优化切歌流程确保状态正确初始化
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.

