fix jellyfin webhook invalid json payload

{{{Overview}}} inserts raw multi-line text, so literal newline and control characters end up inside the JSON string.
This commit is contained in:
FuzzyGrim
2026-04-04 22:04:42 +02:00
parent 53cbedbb0d
commit fb5bfe09c7

View File

@@ -82,35 +82,21 @@
<div class="relative mt-2"> <div class="relative mt-2">
<textarea readonly id="jellyfin-json-template" class="w-full bg-[#39404b] rounded-md text-gray-300 text-sm border-0 focus:ring-0 outline-none font-mono p-3 resize-none overflow-auto max-h-72" rows="14"> <textarea readonly id="jellyfin-json-template" class="w-full bg-[#39404b] rounded-md text-gray-300 text-sm border-0 focus:ring-0 outline-none font-mono p-3 resize-none overflow-auto max-h-72" rows="14">
{% verbatim %}{ {% verbatim %}{
{{#if_equals NotificationType 'PlaybackStart'}} "Event": "{{#if_equals NotificationType 'PlaybackStart'}}Play{{/if_equals}}{{#if_equals NotificationType 'PlaybackStop'}}Stop{{/if_equals}}",
"Event": "Play",
{{/if_equals}}
{{#if_equals NotificationType 'PlaybackStop'}}
"Event": "Stop",
{{/if_equals}}
"Item": { "Item": {
"Id": "{{{ItemId}}}", "Type": "{{ItemType}}",
"Type": "{{{ItemType}}}",
"Name": "{{{Name}}}",
"Overview": "{{{Overview}}}",
"ProductionYear": "{{{Year}}}",
{{#if_equals ItemType 'Episode'}}
"SeriesName": "{{{SeriesName}}}",
"ParentIndexNumber": {{{SeasonNumber}}},
"IndexNumber": {{{EpisodeNumber}}},
{{/if_equals}}
"ProviderIds": { "ProviderIds": {
"Tmdb": "{{{Provider_tmdb}}}", "Tmdb": "{{Provider_tmdb}}",
"Imdb": "{{{Provider_imdb}}}", "Imdb": "{{Provider_imdb}}",
"Tvdb": "{{{Provider_tvdb}}}" "Tvdb": "{{Provider_tvdb}}"
}, },
"UserData": { "UserData": {
{{#if_equals PlayedToCompletion 'True'}} "Played": {{#if_equals PlayedToCompletion 'True'}}true{{else}}false{{/if_equals}}
"Played": "True" }{{#if_equals ItemType 'Episode'}},
{{else}} "SeriesName": "{{SeriesName}}",
"Played": "" "ParentIndexNumber": {{SeasonNumber}},
{{/if_equals}} "IndexNumber": {{EpisodeNumber}}
} {{/if_equals}}
} }
}{% endverbatim %}</textarea> }{% endverbatim %}</textarea>
<span class="absolute top-3 right-3 flex items-center cursor-pointer group" <span class="absolute top-3 right-3 flex items-center cursor-pointer group"