diff --git a/lib/asciinema/streaming/live_stream_server.ex b/lib/asciinema/streaming/live_stream_server.ex index f45290454..f48c88523 100644 --- a/lib/asciinema/streaming/live_stream_server.ex +++ b/lib/asciinema/streaming/live_stream_server.ex @@ -31,7 +31,7 @@ defmodule Asciinema.Streaming.LiveStreamServer do GenServer.call(via_tuple(stream_id), :heartbeat) end - def subscribe(stream_id, type) when type in [:reset, :feed, :offline] do + def subscribe(stream_id, type) when type in [:reset, :feed, :offline, :metadata] do PubSub.subscribe(topic_name(stream_id, type)) end @@ -165,12 +165,21 @@ defmodule Asciinema.Streaming.LiveStreamServer do stream = case state.vt_size do {cols, rows} -> - Streaming.update_live_stream(state.stream, - current_viewer_count: state.viewer_count, - cols: cols, - rows: rows, - snapshot: generate_snapshot(state.vt) - ) + stream = + Streaming.update_live_stream(state.stream, + current_viewer_count: state.viewer_count, + cols: cols, + rows: rows, + snapshot: generate_snapshot(state.vt) + ) + + publish(state.stream_id, %Update{ + stream_id: state.stream_id, + event: :metadata, + data: stream + }) + + stream nil -> state.stream diff --git a/lib/asciinema_web/controllers/live_stream/card.html.heex b/lib/asciinema_web/controllers/live_stream/card.html.heex index 2b6081b9e..88428b574 100644 --- a/lib/asciinema_web/controllers/live_stream/card.html.heex +++ b/lib/asciinema_web/controllers/live_stream/card.html.heex @@ -26,7 +26,6 @@ by <.link href={author_profile_path(@stream)}><%= author_username(@stream) %> - <%= time_ago_tag(@stream.last_started_at) %> diff --git a/lib/asciinema_web/controllers/user/show.html.heex b/lib/asciinema_web/controllers/user/show.html.heex index 5b7432684..9ebabc133 100644 --- a/lib/asciinema_web/controllers/user/show.html.heex +++ b/lib/asciinema_web/controllers/user/show.html.heex @@ -41,7 +41,9 @@