Changes Summary - v1.6.1.0
Bug Fixes
-
DiscordSender.cs — Replaced new HttpClient() (memory leak) with IHttpClientFactory injection. Removed IDisposable implementation.
-
PluginServiceRegistrator.cs — Fixed inconsistent DI lifetimes: all consumers and sender are now AddSingleton. Removed the pointless AddScoped registration (config is already accessible via Plugin.Config).
-
UserCreatedNotifier.cs / UserDeletedNotifier.cs — Removed unused IServerApplicationHost dependency from constructors.
-
TestNotifierController.cs — Replaced new DiscordSender(senderLogger) with proper DI injection.
-
Jellyfin.Plugin.DiscordNotifier.csproj — Bumped Jellyfin.Controller from 10.10.0 to 10.11.0 to match the running server version, fixing the TypeLoadException on Jellyfin.Data.Entities.User.
-
PluginConfiguration.cs — Removed unused using Jellyfin.Plugin.DiscordNotifier.Notifiers.
Features
-
Models/DiscordModels.cs — Added typed models (DiscordWebhookPayload, DiscordEmbed, DiscordEmbedField, DiscordEmbedFooter) with [JsonPropertyName] attributes, replacing anonymous objects across all templates.
-
DiscordEmbedFooter.FromConfig() — Static helper that automatically builds the footer text using ServerName if configured (e.g. "Home Server • Jellyfin"), falling back to "Jellyfin Discord Notifier".
Refacto
-
All 4 templates — Return type changed from object to DiscordWebhookPayload. Removed private static readonly ILogger _logger = Plugin.Logger (potential null reference at static init time). Replaced anonymous objects with typed models.
-
Embed colors — Made consistent using hex literals (0x4C8BF5, 0xE74C3C, 0x2ECC71).