Skip to content

Commit

Permalink
docs(ntfy) remove trailing commas and remove text error (#215)
Browse files Browse the repository at this point in the history
The trailing commas were leading to invalid json as it does
not allow trailing commas. The "PlaybackStart" text was also
containing the word "stopped" which didn't match it.
  • Loading branch information
lucavb authored Jan 16, 2024
1 parent 59fa8e5 commit 6e853fe
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Jellyfin.Plugin.Webhook/Templates/Ntfy.handlebars
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
{
"topic": "jellyfin",
"tags": ["octopus"],
{{#if_equals NotificationType 'PlaybackStart'}}
{{#if_equals NotificationType 'PlaybackStart'}}
"title": "{{{NotificationUsername}}} Playback Started",
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Episode'}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}",
"message": "{{{NotificationUsername}}} started playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}"
{{else}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}",
{{/if_equals}}
"message": "{{{NotificationUsername}}} started playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}"
{{/if_equals}}
{{/if_equals}}
{{#if_equals NotificationType 'PlaybackStop'}}

{{#if_equals NotificationType 'PlaybackStop'}}
"title": "{{{NotificationUsername}}} Playback Stopped",
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Episode'}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}",
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}"
{{else}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}",
{{/if_equals}}
{{/if_equals}}
{{#if_equals NotificationType 'ItemAdded'}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}"
{{/if_equals}}
{{/if_equals}}

{{#if_equals NotificationType 'ItemAdded'}}
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Movie'}}
"title": "Movie Added",
"message": "{{ItemType}} Now Available\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
{{/if_equals}}
{{/if_equals}}
{{#if_equals ItemType 'Season'}}
"title": "Season Added",
"message": "{{ItemType}} Now Available\n\n{{{SeriesName}}} ({{Year}})\n{{{Name}}}\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
Expand All @@ -38,10 +38,10 @@
"message": "Episode Now Available\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
{{/if_equals}}
{{/if_equals}}

{{#if_equals NotificationType 'PendingRestart'}}
"title": "Jellyfin Restart Required",
"priority": 4,
"message": "Jellyfin needs to be restarted, please restart jellyfin as soon as possible!"
{{/if_equals}}
}
}

0 comments on commit 6e853fe

Please sign in to comment.