mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat: play-by-id and play-playlist endpoints, fix lyrics sync timing
- New endpoints: play-by-id, add-by-id, play-playlist (load all songs at once) - Playlist 'Play All' now uses server-side bulk load (no N sequential searches) - Search/Home/Playlist views use playById instead of search-by-name - Fixed updateBotStatus timing: capture prev state before mutation - Early return on song change prevents stale pause/resume logic Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2c87f1cff9
commit
2e4d6d8d40
6 files changed
+163
-20
No files matched your search
@@ -31,8 +31,8 @@
|
||||
:song="song"
|
||||
:index="i + 1"
|
||||
:active="store.currentSong?.id === song.id"
|
||||
@play="store.play(song.name, song.platform)"
|
||||
@add="store.addToQueue(song.name, song.platform)"
|
||||
@play="store.playById(song.id, song.platform)"
|
||||
@add="store.addToQueueById(song.id, song.platform)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -76,13 +76,9 @@ const songs = ref<SongItem[]>([]);
|
||||
const loading = ref(true);
|
||||
|
||||
async function playAll() {
|
||||
if (songs.value.length > 0) {
|
||||
const first = songs.value[0];
|
||||
await store.play(first.name, first.platform);
|
||||
for (let i = 1; i < songs.value.length; i++) {
|
||||
await store.addToQueue(songs.value[i].name, songs.value[i].platform);
|
||||
}
|
||||
}
|
||||
const id = route.params.id as string;
|
||||
const platform = (route.query.platform as string) || 'netease';
|
||||
await store.playPlaylist(id, platform);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in new issue
Block a user