From 4d7a3d0909437268b4ad0a0dbeb59d45b4435118 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 23 Sep 2024 06:33:03 -0700 Subject: [PATCH] New: Errors sending Telegram notifications when links aren't available Closes #7240 --- .../Notifications/Telegram/Telegram.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs index 4d23c3ac9..ba0c2d6dc 100644 --- a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs +++ b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs @@ -69,28 +69,29 @@ namespace NzbDrone.Core.Notifications.Telegram { var title = Settings.IncludeAppNameInTitle ? HEALTH_ISSUE_TITLE_BRANDED : HEALTH_ISSUE_TITLE; - _proxy.SendNotification(title, healthCheck.Message, null, Settings); + _proxy.SendNotification(title, healthCheck.Message, new List(), Settings); } public override void OnHealthRestored(HealthCheck.HealthCheck previousCheck) { var title = Settings.IncludeAppNameInTitle ? HEALTH_RESTORED_TITLE_BRANDED : HEALTH_RESTORED_TITLE; - _proxy.SendNotification(title, $"The following issue is now resolved: {previousCheck.Message}", null, Settings); + _proxy.SendNotification(title, $"The following issue is now resolved: {previousCheck.Message}", new List(), Settings); } public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage) { var title = Settings.IncludeAppNameInTitle ? APPLICATION_UPDATE_TITLE_BRANDED : APPLICATION_UPDATE_TITLE; - _proxy.SendNotification(title, updateMessage.Message, null, Settings); + _proxy.SendNotification(title, updateMessage.Message, new List(), Settings); } public override void OnManualInteractionRequired(ManualInteractionRequiredMessage message) { var title = Settings.IncludeAppNameInTitle ? MANUAL_INTERACTION_REQUIRED_TITLE_BRANDED : MANUAL_INTERACTION_REQUIRED_TITLE; + var links = GetLinks(message.Series); - _proxy.SendNotification(title, message.Message, null, Settings); + _proxy.SendNotification(title, message.Message, links, Settings); } public override ValidationResult Test() @@ -106,6 +107,11 @@ namespace NzbDrone.Core.Notifications.Telegram { var links = new List(); + if (series == null) + { + return links; + } + foreach (var link in Settings.MetadataLinks) { var linkType = (MetadataLinkType)link;