From 377bf65628b7e8e599467e42acf0ba809c681e59 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Fri, 24 Apr 2026 09:51:42 +0200 Subject: [PATCH] fix(ntfy): remove undefined fields from ntfy payload (#2931) --- server/lib/notifications/agents/ntfy.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/lib/notifications/agents/ntfy.ts b/server/lib/notifications/agents/ntfy.ts index 50f429622..fae329a00 100644 --- a/server/lib/notifications/agents/ntfy.ts +++ b/server/lib/notifications/agents/ntfy.ts @@ -95,15 +95,21 @@ class NtfyAgent click = `${applicationUrl}/${payload.media.mediaType}/${payload.media.tmdbId}`; } - return { + const ntfyPayload: Record = { topic, priority, title, message, markdown: true, - attach, - click, }; + if (attach) { + ntfyPayload.attach = attach; + } + if (click) { + ntfyPayload.click = click; + } + + return ntfyPayload; } public shouldSend(): boolean {