Skip to content

Commit

Permalink
fix: Upgradaintorr - Enhance Discord webhook configuration to support…
Browse files Browse the repository at this point in the history
… general settings
  • Loading branch information
angrycuban13 committed Jan 11, 2025
1 parent 9cedddf commit 0142243
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions Upgradinatorr/upgradinatorr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1756,15 +1756,30 @@ if ($PSCmdlet.ShouldProcess($configurationFile, "Validating `"Notifications`" se
throw 'Notifications section is not configured correctly, please correct any warnings and try again'
}

if (-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.DiscordWebhook)) {
if ((-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.DiscordWebhook)) -or (-Not [string]::IsNullOrWhiteSpace($configuration.General.DiscordWebhook))) {
$sendDiscordNotification = $true
$discordWebhookUrl = $configuration.Notifications.DiscordWebhook

if (-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.DiscordWebhook)) {
$discordWebhookUrl = $configuration.Notifications.DiscordWebhook
}

if (-Not [string]::IsNullOrWhiteSpace($configuration.General.DiscordWebhook)) {
$discordWebhookUrl = $configuration.General.DiscordWebhook
}
}

if (-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.NotifiarrPassthroughWebhook)) {
if ((-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.NotifiarrPassthroughWebhook)) -or (-Not [string]::IsNullOrWhiteSpace($configuration.General.NotifiarrPassthroughWebhook))) {
$sendNotifiarrNotification = $true
$notifiarrWebhookUrl = $configuration.Notifications.NotifiarrPassthroughWebhook
$notifiarrChannelId = $configuration.Notifications.NotifiarrPassthroughDiscordChannelId

if (-Not [string]::IsNullOrWhiteSpace($configuration.Notifications.NotifiarrPassthroughWebhook)) {
$notifiarrWebhookUrl = $configuration.Notifications.NotifiarrPassthroughWebhook
$notifiarrChannelId = $configuration.Notifications.NotifiarrPassthroughDiscordChannelId
}

if (-Not [string]::IsNullOrWhiteSpace($configuration.General.NotifiarrPassthroughWebhook)) {
$notifiarrWebhookUrl = $configuration.General.NotifiarrPassthroughWebhook
$notifiarrChannelId = $configuration.General.NotifiarrPassthroughDiscordChannelId
}
}
}

Expand Down

0 comments on commit 0142243

Please sign in to comment.