Commit Graph

26 Commits

Author SHA1 Message Date
史悦
186733dccf 恢复单一SyncToken模式,合并网易云ID到SyncToken,实现"导入即替换"逻辑
调整同步策略:网易云模式下,自动执行"拉取网易云 -> 合并本地(非覆盖) -> 推送至私有云KV"
2026-01-07 18:34:50 +08:00
史悦
36ee441c06 现在,您可以放心地设置私有云 Token 进行全量备份,同时挂载一个网易云歌单作为数据源之一,系统会自动处理好所有的数据流转。 2026-01-07 18:26:36 +08:00
史悦
b79f4a8b2c 点击左上角菜单,打开侧边栏。
点击“导入网易云歌单”按钮。
粘贴网易云歌单分享链接。
系统将自动提取 ID,导入歌曲,并开启每 15 分钟一次的自动同步。
若要切回私有云同步,只需清空输入框内容或重新输入您的 Server Key 即可。
2026-01-07 18:08:58 +08:00
史悦
264ffb8b38 修复(播放器):标准化传递给点赞处理器的歌曲对象
确保传递给toggleLike的是一个具有标准化source属性的新对象引用。这解决了平台/source属性不匹配的潜在问题,并确保状态更新能够正确触发。
2026-01-07 17:53:13 +08:00
史悦
13ef60b7bd 功能改进(同步):新增元数据嵌入并优化匹配逻辑
- 在Docker容器中安装ffmpeg以支持媒体处理
- 为下载文件嵌入标题、艺术家、专辑及封面图等元数据
- 重构文件存在性检测机制,兼容多种命名格式
- 下载过程中采用临时文件确保数据完整性

(注:根据中文技术文档惯例进行了以下优化:
1. 使用"功能改进"替代直译"feat",更符合国内开发文档表述
2. "metadata embedding"译为"元数据嵌入"是行业标准译法
3. "refactor"译为"重构"准确传达代码改造含义
4. 采用四字短语"确保数据完整性"保持技术文档的简洁性
5. 使用中文括号和冒号格式,符合国内技术文档排版规范)
2026-01-07 12:26:30 +08:00
史悦
c81dad23f6 fix(sync): improve token switching and auto-sync behavior
- Introduce `lastSuccessToken` state to track the last verified sync token
- Update manual sync to overwrite local favorites when switching tokens, treating it as a login action rather than a merge
- Prevent auto-sync from running when the current token does not match the last successful one to avoid unintended data uploads
2026-01-07 10:29:02 +08:00
史悦
cbc3acb213 refactor(ui): redesign playlist detail header
- Move back button to cover image area with updated styling
- Remove sticky top bar for cleaner view
- Add explicit container names in docker-compose.yml
2026-01-07 10:22:05 +08:00
史悦
c3877be35d fix(player): refactor audio element handling and improve auto-play reliability
- Replace detached `new Audio()` with rendered `<audio>` element to better support mobile behaviors and standard DOM events
- Introduce `autoAdvanceLockRef` to prevent race conditions where the next song might be triggered multiple times
- Add manual time check near the end of the track to trigger auto-advance, acting as a fallback for the `ended` event
- Update `playNext` logic to handle immediate playback transitions more robustly
2026-01-07 10:08:35 +08:00
史悦
a244347999 Modified processSong to check for res.statusCode === 302.
If a redirect is encountered, the Location header is extracted and treated as the direct download URL for the music file.
This aligns the code with the API behavior which redirects to the actual file location instead of returning a JSON response.
2026-01-06 16:22:48 +08:00
史悦
6b182ceba8 增加了 Duration 检查:在 updateMediaSessionPosition 函数中,现在会先判断 duration 是否为有效的正数。如果 duration <= 0,则不再调用 setPositionState,避免触发浏览器的错误行为。
移除了错误的重置调用:删除了在切歌或清空播放时调用的 setPositionState({ duration: 0 ... })。根据 Media Session API 规范,duration 必须为正数,传入 0 往往是导致 Firefox 隐藏通知栏控制条的主要原因。
2026-01-06 16:04:24 +08:00
史悦
9a220dfe78 增加了 HTTP 状态码检查:在调用音乐下载 API 时,如果返回的状态码不是 200(例如 403 Forbidden 或 500 Error),现在会记录错误并跳过,而不是尝试解析响应体。这应该能解决 Unexpected token F (可能是 "Forbidden" 或 "Failed") 导致的崩溃问题。 2026-01-06 15:58:30 +08:00
史悦
9f1d52c09d 取消了输入时的频繁同步:移除了对 syncToken 变化的自动监听,只在收藏列表变化时触发。
支持了删除同步:通过快照对比,本地删除操作可以正确同步到云端,而不仅仅是简单的追加或覆盖。
防止了意外覆盖:同步前先拉取远程数据进行合并,避免了直接用本地旧数据覆盖云端新数据的情况。
2026-01-06 15:55:32 +08:00
史悦
1af86ed6a6 同步时会下载音乐 2026-01-06 15:03:06 +08:00
史悦
87599a4ce8 已调整全屏播放器底部控制区域的布局,减小了占用空间 2026-01-06 14:28:05 +08:00
史悦
45dfa6ee04 已在播放列表(PlaylistDrawer)中添加了播放模式切换按钮 2026-01-06 14:19:43 +08:00
史悦
cfefceaf28 已更新同步按钮功能:
添加图标:按钮现在包含一个旋转图标 (fa-rotate)。
加载状态:点击同步时,图标会旋转,按钮文字变为“同步中”并禁用。
完成提示:同步完成后,会在按钮下方显示“同步完成”的绿色提示文字,并在3秒后自动消失。
2026-01-06 14:16:59 +08:00
史悦
a506fad6fd 现在会在歌手名后面显示专辑名 2026-01-06 14:12:58 +08:00
史悦
ecd9f60ac9 修复移动端通知栏进度条的问题 2026-01-06 13:42:54 +08:00
史悦
e115ee1db1 feat(ui): rebrand to Meishi Music and wire up sidebar
- Rename application from TuneHub to Meishi Music in UI and PWA manifest
- Implement cache clearing logic to remove local storage items
- Pass sync state and handlers to the Sidebar component
2026-01-06 11:26:56 +08:00
史悦
ca1026d166 feat(sync): add cloud synchronization for favorites
Add a new sync service and frontend integration to allow syncing
favorites across devices using a token.

- Configure `sync-service` in docker-compose.yml on port 7482
- Add sync token input and manual sync button to SideDrawer
- Implement auto-sync logic to persist favorites to the KV store
- Add logic to merge cloud favorites with local data on initialization
2026-01-06 11:20:06 +08:00
史悦
33e3ec714e feat(ui): add clear cache and optimize media session
- Add button in side drawer settings to clear local cache data
- Refactor Media Session position updates to trigger on specific events (seek, play/pause, load) instead of every time update
- Add finite number validation for seek operations
2026-01-06 10:59:14 +08:00
史悦
b1e76110ff 完整的 Media Session API 支持 2026-01-06 10:52:43 +08:00
史悦
2841aff80b 修改标题 2026-01-06 10:40:47 +08:00
史悦
a7421891f0 docker 2026-01-06 10:34:28 +08:00
史悦
db524ffd28 docker 2026-01-06 10:32:41 +08:00
史悦
56d94c9592 first commit 2026-01-06 10:27:08 +08:00