Fix registering helpers during plugin initialization (#230)

This commit is contained in:
Cody Robibero 2024-05-13 17:37:42 -06:00 committed by GitHub
parent 96d9f3418c
commit 3a31a5f6c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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;
}

View File

@ -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
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
HandlebarsFunctionHelpers.RegisterHelpers();
serviceCollection.AddScoped<IWebhookClient<DiscordOption>, DiscordClient>();
serviceCollection.AddScoped<IWebhookClient<GenericOption>, GenericClient>();
serviceCollection.AddScoped<IWebhookClient<GenericFormOption>, GenericFormClient>();