feat: 双击播放队列中的歌曲(不清空队列)

- 新增 POST /api/player/:botId/play-at 端点,跳转到队列指定索引
- 使用 queue.playAt(index) + resolveAndPlay,保留队列完整
- Queue.vue 添加 @dblclick 处理,双击即播放对应歌曲
- 添加 store.playAtIndex() action

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.6 committed 2026-03-30 14:37:53 +08:00
1 parent 17991b936a
commit d8c0911593
3 files changed
+41

No files matched your search

+8
View File
@@ -18,6 +18,7 @@
:key="`${song.id}-${i}`"
class="queue-item"
:class="{ active: store.currentSong?.id === song.id }"
@dblclick="playAtIndex(i)"
>
<CoverArt :url="song.coverUrl" :size="32" :radius="4" />
<div class="queue-song-info">
@@ -54,6 +55,11 @@ watch(() => props.open, (isOpen) => {
if (isOpen) store.fetchQueue();
});
async function playAtIndex(index: number) {
await store.playAtIndex(index);
await store.fetchQueue();
}
async function removeSong(index: number) {
if (!store.activeBotId) return;
try {
@@ -130,6 +136,8 @@ async function removeSong(index: number) {
padding: 8px;
border-radius: var(--radius-sm);
transition: background var(--transition-fast);
cursor: pointer;
user-select: none;
&:hover {
background: var(--hover-bg);