This commit is contained in:
阿梓喵_あずにゃん committed 2026-04-20 23:48:46 +08:00
1 parent 1bd6ab9975
commit 47514f57aa
9 files changed
+91 -104

No files matched your search

+13 -1
View File
@@ -8,7 +8,7 @@ export interface Song {
album: string;
duration: number;
coverUrl: string;
platform: 'netease' | 'qq';
platform: 'netease' | 'qq' | 'bilibili' | 'youtube';
}
export interface BotStatus {
@@ -259,6 +259,13 @@ export const usePlayerStore = defineStore('player', {
this._syncAfterAction();
},
async playSong(song: Song) {
if (!this.activeBotId) return;
await axios.post(`/api/player/${this.activeBotId}/play-song`, { song });
this._setTiming(this.activeBotId, { serverElapsed: 0 });
this._syncAfterAction();
},
async addToQueue(query: string, platform = 'netease') {
if (!this.activeBotId) return;
await axios.post(`/api/player/${this.activeBotId}/add`, { query, platform });
@@ -269,6 +276,11 @@ export const usePlayerStore = defineStore('player', {
await axios.post(`/api/player/${this.activeBotId}/add-by-id`, { songId, platform });
},
async addSong(song: Song) {
if (!this.activeBotId) return;
await axios.post(`/api/player/${this.activeBotId}/add-song`, { song });
},
async playPlaylist(playlistId: string, platform = 'netease') {
if (!this.activeBotId) return;
await axios.post(`/api/player/${this.activeBotId}/play-playlist`, { playlistId, platform });