mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
New: Errors sending Telegram notifications when links aren't available
Closes #7240
This commit is contained in:
committed by
Mark McDowall
parent
30a52d11aa
commit
4d7a3d0909
@@ -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<TelegramLink>(), 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<TelegramLink>(), 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<TelegramLink>(), 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<TelegramLink>();
|
||||
|
||||
if (series == null)
|
||||
{
|
||||
return links;
|
||||
}
|
||||
|
||||
foreach (var link in Settings.MetadataLinks)
|
||||
{
|
||||
var linkType = (MetadataLinkType)link;
|
||||
|
||||
Reference in New Issue
Block a user