From 3a31a5f6c940b31c0efed48257847e18a2985adb Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Mon, 13 May 2024 17:37:42 -0600 Subject: [PATCH] Fix registering helpers during plugin initialization (#230) --- .../Notifiers/ItemAddedNotifier/ItemAddedNotifierEntryPoint.cs | 2 -- Jellyfin.Plugin.Webhook/PluginServiceRegistrator.cs | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.Webhook/Notifiers/ItemAddedNotifier/ItemAddedNotifierEntryPoint.cs b/Jellyfin.Plugin.Webhook/Notifiers/ItemAddedNotifier/ItemAddedNotifierEntryPoint.cs index a0417c9..821de81 100644 --- a/Jellyfin.Plugin.Webhook/Notifiers/ItemAddedNotifier/ItemAddedNotifierEntryPoint.cs +++ b/Jellyfin.Plugin.Webhook/Notifiers/ItemAddedNotifier/ItemAddedNotifierEntryPoint.cs @@ -1,6 +1,5 @@ using System.Threading; using System.Threading.Tasks; -using Jellyfin.Plugin.Webhook.Helpers; using MediaBrowser.Controller.Library; using Microsoft.Extensions.Hosting; @@ -42,7 +41,6 @@ public class ItemAddedNotifierEntryPoint : IHostedService public Task StartAsync(CancellationToken cancellationToken) { _libraryManager.ItemAdded += ItemAddedHandler; - HandlebarsFunctionHelpers.RegisterHelpers(); return Task.CompletedTask; } diff --git a/Jellyfin.Plugin.Webhook/PluginServiceRegistrator.cs b/Jellyfin.Plugin.Webhook/PluginServiceRegistrator.cs index 1f9efb5..90bf07f 100644 --- a/Jellyfin.Plugin.Webhook/PluginServiceRegistrator.cs +++ b/Jellyfin.Plugin.Webhook/PluginServiceRegistrator.cs @@ -11,6 +11,7 @@ using Jellyfin.Plugin.Webhook.Destinations.Pushbullet; using Jellyfin.Plugin.Webhook.Destinations.Pushover; using Jellyfin.Plugin.Webhook.Destinations.Slack; using Jellyfin.Plugin.Webhook.Destinations.Smtp; +using Jellyfin.Plugin.Webhook.Helpers; using Jellyfin.Plugin.Webhook.Notifiers; using Jellyfin.Plugin.Webhook.Notifiers.ItemAddedNotifier; using MediaBrowser.Common.Updates; @@ -36,6 +37,8 @@ public class PluginServiceRegistrator : IPluginServiceRegistrator /// public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost) { + HandlebarsFunctionHelpers.RegisterHelpers(); + serviceCollection.AddScoped, DiscordClient>(); serviceCollection.AddScoped, GenericClient>(); serviceCollection.AddScoped, GenericFormClient>();