fix(qq-fm): guard FM start when offline + reset radar page on re-login [#88 review]

- startFm() now refuses with 'Bot is not connected to TeamSpeak' before mutating the
  queue, so POST /api/player/:id/fm can no longer wipe the queue and flip the bot into
  FM mode while disconnected (the !fm chat command already had this guard).
- The /fm route's success detection also treats 'not connected' as a failure so the
  toast type is correct.
- QQMusicProvider.setCookie() resets radarPage to 1 so a re-login with a different
  account no longer inherits the previous account's radar pagination cursor.
This commit is contained in:
saopig1 committed 2026-06-16 14:48:01 +08:00
1 parent 9bfe831022
commit 6e10764d28
3 files changed
+16 -1

No files matched your search

+3
View File
@@ -462,6 +462,9 @@ export class QQMusicProvider implements MusicProvider {
setCookie(cookie: string): void {
this.cookie = cookie;
// Reset radar pagination so a re-login (different account) starts from the
// first page rather than inheriting the previous account's cursor.
this.radarPage = 1;
}
getCookie(): string {