diff --git a/platform/api/src/video_event_handler.rs b/platform/api/src/video_event_handler.rs index f69dd5bb..70726d07 100644 --- a/platform/api/src/video_event_handler.rs +++ b/platform/api/src/video_event_handler.rs @@ -88,7 +88,7 @@ async fn handle_room_event(global: &Arc, event: event::Room, ti connection_id: Some(connection_id), .. }) => { - let res: Option<(common::database::Ulid,)> = sqlx::query_as("UPDATE users SET channel_active_connection_id = NULL, channel_live_viewer_count = NULL, channel_live_viewer_count_updated_at = NOW() WHERE channel_room_id = $1 AND channel_active_connection_id = $2 RETURNING id") + let res: Option<(common::database::Ulid,)> = sqlx::query_as("UPDATE users SET channel_active_connection_id = NULL, channel_live_viewer_count = 0, channel_live_viewer_count_updated_at = NOW() WHERE channel_room_id = $1 AND channel_active_connection_id = $2 RETURNING id") .bind(Ulid::from(room_id.into_ulid())) .bind(Ulid::from(connection_id.into_ulid())) .fetch_optional(global.db().as_ref()) diff --git a/platform/migrations/20230825170300_init.up.sql b/platform/migrations/20230825170300_init.up.sql index bc9b9ba8..996fa7fd 100644 --- a/platform/migrations/20230825170300_init.up.sql +++ b/platform/migrations/20230825170300_init.up.sql @@ -31,7 +31,7 @@ CREATE TABLE users ( channel_room_id UUID NOT NULL, channel_active_connection_id UUID DEFAULT NULL, channel_title VARCHAR(256), - channel_live_viewer_count INT4, + channel_live_viewer_count INT4 NOT NULL DEFAULT 0, channel_live_viewer_count_updated_at TIMESTAMPTZ, channel_description TEXT, channel_links JSONB NOT NULL DEFAULT '[]'::JSONB, diff --git a/platform/website/src/components/channel/title.svelte b/platform/website/src/components/channel/title.svelte index 87120c04..f853eca3 100644 --- a/platform/website/src/components/channel/title.svelte +++ b/platform/website/src/components/channel/title.svelte @@ -46,4 +46,6 @@ }); -{title} +{#if title} + {title} +{/if} diff --git a/platform/website/src/components/side-nav/streamer-card.svelte b/platform/website/src/components/side-nav/streamer-card.svelte index 118848dd..6dae0292 100644 --- a/platform/website/src/components/side-nav/streamer-card.svelte +++ b/platform/website/src/components/side-nav/streamer-card.svelte @@ -1,7 +1,7 @@