summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mediasync/router.ex4
-rw-r--r--priv/static/discordActivity.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/mediasync/router.ex b/lib/mediasync/router.ex
index 2e8b421..3219300 100644
--- a/lib/mediasync/router.ex
+++ b/lib/mediasync/router.ex
@@ -231,13 +231,13 @@ defmodule Mediasync.Router do
get "/discord_activity/rooms_for_instance" do
if Application.fetch_env!(:mediasync, :enable_discord_activity?) do
values =
- for {_pid, value} <-
+ for {pid, value} <-
Registry.match(
Mediasync.DiscordActivityInstanceRegistry,
conn.query_params["instance_id"],
:_
) do
- value
+ Map.put(value, "filename", Path.basename(URI.new!(Mediasync.Room.get_video_info(pid).url).path))
end
conn
diff --git a/priv/static/discordActivity.js b/priv/static/discordActivity.js
index 9cdaaf1..ad7a6c3 100644
--- a/priv/static/discordActivity.js
+++ b/priv/static/discordActivity.js
@@ -26,7 +26,9 @@ const updateInstanceRoomInfo = () => {
const listEl = docFragment.appendChild(document.createElement("ul"));
for (const roomInfo of json) {
const item = listEl.appendChild(document.createElement("li"));
- item.textContent = roomInfo["host_username"] + " ";
+ item.textContent = roomInfo["host_username"] + " — ";
+ const filename = item.appendChild(document.createElement("code"));
+ filename.textContent = roomInfo["filename"] + " ";
const form = item.appendChild(document.createElement("form"));
form.action = roomUrl(roomInfo["room_id"]);
form.target = "activity-inner-iframe";