From 0bd0912613f0db24bd0da4ec956b5119133e35d4 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Sat, 13 Mar 2021 23:52:54 -0500 Subject: [PATCH] fix(notif): set URL for Discord embeds rather than adding a field for the link (#1167) --- server/lib/notifications/agents/discord.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/server/lib/notifications/agents/discord.ts b/server/lib/notifications/agents/discord.ts index 7358d786f..5c02240e9 100644 --- a/server/lib/notifications/agents/discord.ts +++ b/server/lib/notifications/agents/discord.ts @@ -156,15 +156,14 @@ class DiscordAgent break; } - if (settings.main.applicationUrl && payload.media) { - fields.push({ - name: `Open in ${settings.main.applicationTitle}`, - value: `${settings.main.applicationUrl}/${payload.media?.mediaType}/${payload.media?.tmdbId}`, - }); - } + const url = + settings.main.applicationUrl && payload.media + ? `${settings.main.applicationUrl}/${payload.media.mediaType}/${payload.media.tmdbId}` + : undefined; return { title: payload.subject, + url, description: payload.message, color, timestamp: new Date().toISOString(),