mirror of
https://github.com/Sonarr/Sonarr
synced 2025-12-06 08:28:37 +01:00
New: Errors sending Telegram notifications when links aren't available
Closes #7240
This commit is contained in:
parent
30a52d11aa
commit
4d7a3d0909
1 changed files with 10 additions and 4 deletions
|
|
@ -69,28 +69,29 @@ public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck)
|
|||
{
|
||||
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 @@ private List<TelegramLink> GetLinks(Series series)
|
|||
{
|
||||
var links = new List<TelegramLink>();
|
||||
|
||||
if (series == null)
|
||||
{
|
||||
return links;
|
||||
}
|
||||
|
||||
foreach (var link in Settings.MetadataLinks)
|
||||
{
|
||||
var linkType = (MetadataLinkType)link;
|
||||
|
|
|
|||
Loading…
Reference in a new issue