Merge pull request 'Discord: several radio streams per voice channel; adding never overwrites (#213)' (#227) from fix/213-multi-stream-per-channel into main
This commit was merged in pull request #227.
This commit is contained in:
@@ -76,6 +76,9 @@ export const c2api = {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(body),
|
||||
}),
|
||||
/** Without stream_id: ADD a stream to the voice channel (a channel can carry
|
||||
* several, each its own bot + system; never replaces one). With stream_id:
|
||||
* restart / edit that stream. */
|
||||
startDiscordStream: (body: {
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
@@ -83,6 +86,7 @@ export const c2api = {
|
||||
mode: "persistent" | "adhoc";
|
||||
channel_name?: string;
|
||||
preferred_token_id?: string;
|
||||
stream_id?: string;
|
||||
}) => request<DiscordStream>("/discord/streams", { method: "POST", body: JSON.stringify(body) }),
|
||||
/** Permanently remove a radio channel (stopped through desired state first). Admin only. */
|
||||
deleteDiscordStream: (streamId: string) =>
|
||||
@@ -99,10 +103,11 @@ export const c2api = {
|
||||
}>(`/discord/guilds/${encodeURIComponent(guildId)}?leave_radio_bots=${leaveRadioBots ? "true" : "false"}`, {
|
||||
method: "DELETE",
|
||||
}),
|
||||
stopDiscordStream: (guildId: string, channelId: string) =>
|
||||
/** Stop ONE stream (its voice channel may carry others, which keep playing). */
|
||||
stopDiscordStream: (guildId: string, streamId: string) =>
|
||||
request<{ stopped: string[] }>(`/discord/guilds/${encodeURIComponent(guildId)}/stop`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ channel_id: channelId, reason: "stopped from web admin" }),
|
||||
body: JSON.stringify({ stream_id: streamId, reason: "stopped from web admin" }),
|
||||
}),
|
||||
|
||||
// Node approval
|
||||
|
||||
@@ -67,6 +67,8 @@ export interface DiscordStream {
|
||||
stop_reason?: string | null;
|
||||
updated_at?: string | null;
|
||||
created_at?: string | null;
|
||||
/** POST /discord/streams: this system was already on in that channel — nothing was replaced. */
|
||||
already_on?: boolean;
|
||||
}
|
||||
|
||||
export interface DiscordGuild {
|
||||
|
||||
@@ -18,7 +18,10 @@ export interface DiscordStreamView {
|
||||
channel_id: string;
|
||||
guild_name: string | null;
|
||||
channel_name: string | null;
|
||||
system_id?: string | null;
|
||||
system_name: string | null;
|
||||
/** The radio bot carrying it — tells apart several streams in one voice channel. */
|
||||
token_name?: string | null;
|
||||
mode: "persistent" | "adhoc" | null;
|
||||
node_id: string | null;
|
||||
node_name: string | null;
|
||||
@@ -35,7 +38,10 @@ export interface DiscordVoiceChannel {
|
||||
channel_id: string;
|
||||
name: string;
|
||||
category: string | null;
|
||||
/** This node's system's stream in the channel, if any — what a pick restarts or moves. */
|
||||
stream: DiscordStreamView | null;
|
||||
/** Every live stream in the channel (several systems can share it, each its own bot). */
|
||||
streams?: DiscordStreamView[];
|
||||
}
|
||||
|
||||
export interface DiscordGuildOption {
|
||||
|
||||
Reference in New Issue
Block a user