Commit Graph

17 Commits

Author SHA1 Message Date
史悦
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
史悦
6b182ceba8 增加了 Duration 检查:在 updateMediaSessionPosition 函数中,现在会先判断 duration 是否为有效的正数。如果 duration <= 0,则不再调用 setPositionState,避免触发浏览器的错误行为。
移除了错误的重置调用:删除了在切歌或清空播放时调用的 setPositionState({ duration: 0 ... })。根据 Media Session API 规范,duration 必须为正数,传入 0 往往是导致 Firefox 隐藏通知栏控制条的主要原因。
2026-01-06 16:04:24 +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
史悦
56d94c9592 first commit 2026-01-06 10:27:08 +08:00