From 44b0b5c31c8b52eed138a17ae1a28d543a30f154 Mon Sep 17 00:00:00 2001 From: saopig1 <4x7sw862st@gmail.com> Date: Wed, 6 May 2026 16:40:12 +0800 Subject: [PATCH] feat(web): playNextSong store action Posts to /play-next-song, surfaces failures via the existing Toast, and refreshes the queue panel so the inserted song appears. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/src/stores/player.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/src/stores/player.ts b/web/src/stores/player.ts index 9a14f11..4c1c970 100644 --- a/web/src/stores/player.ts +++ b/web/src/stores/player.ts @@ -287,6 +287,16 @@ export const usePlayerStore = defineStore('player', { this._syncAfterAction(); }, + async playNextSong(song: Song) { + if (!this.activeBotId) return; + const res = await axios.post(`/api/player/${this.activeBotId}/play-next-song`, { song }); + if (res.data?.message) { + this.notify(res.data.message, res.data.ok === false ? 'error' : 'info'); + } + // Refresh queue so the inserted item shows up in the side panel + this.fetchQueue(); + }, + async addToQueue(query: string, platform = 'netease') { if (!this.activeBotId) return; await axios.post(`/api/player/${this.activeBotId}/add`, { query, platform });