Discord: several radio streams per voice channel; adding never overwrites (#213) #227

Merged
logan merged 2 commits from fix/213-multi-stream-per-channel into main 2026-10-05 01:44:36 -04:00
Showing only changes of commit 5c53850cbf - Show all commits
@@ -71,7 +71,7 @@ function AddChannelForm({
setSaving(true);
setError(null);
try {
await c2api.startDiscordStream({
const res = await c2api.startDiscordStream({
guild_id: guildId,
channel_id: channelId.trim(),
system_id: systemId,
@@ -79,6 +79,16 @@ function AddChannelForm({
channel_name: channelName.trim() || undefined,
preferred_token_id: botId || undefined,
});
if (res?.already_on) {
// Same system re-added to a channel that already plays it: c2-core
// returns that stream untouched (label, mode and bot kept). Say so
// instead of closing as if a stream had been added.
setError({
message: `${res.system_name || "That system"} is already playing in this voice channel, so nothing was added or changed. Pick another system to add a second stream, or Remove the existing row to change its label or bot.`,
invite: [],
});
return;
}
onDone();
} catch (err) {
setError(parseC2Error(err));