Skip to content

Instantly share code, notes, and snippets.

@fragande
Last active Nov 16, 2020
Embed
What would you like to do?
Simple PowerShell script for BurntToast Sonarr notifications
Import-Module BurntToast
$eventtype = $env:sonarr_eventtype
$series_title = $env:sonarr_series_title
$rel_episodenumber = $env:sonarr_release_episodenumbers
$rel_seasonnumber = $env:sonarr_release_seasonnumber
$epfile_episodenumber = $env:sonarr_episodefile_episodenumbers
$epfile_seasonnumber = $env:sonarr_episodefile_seasonnumber
$releasename = $env:sonarr_episodefile_scenename
$releasetitle = $env:sonarr_release_title
$isupgrade = $env:sonarr_isupgrade
$applogo = "C:\sonarr_logo.png" #Path to Sonarr logo image
If ($eventtype -eq "Test") {
New-BurntToastNotification -AppLogo $applogo -Text $eventtype, "Sonarr test notification."
}
Elseif ($eventtype -eq "Grab") {
New-BurntToastNotification -AppLogo $applogo -Text " Grabbed: $series_title Season $rel_seasonnumber Episode $rel_episodenumber", $releasetitle
}
Elseif ($eventtype -eq "Download" -And $isupgrade -eq "False") {
New-BurntToastNotification -AppLogo $applogo -Text "Downloaded: $series_title Season $epfile_seasonnumber Episode $epfile_episodenumber", $releasename
}
Elseif ($eventtype -eq "Download" -And $isupgrade -eq "True") {
New-BurntToastNotification -AppLogo $applogo -Text "Upgraded: $series_title Season $epfile_seasonnumber Episode $epfile_episodenumber", $releasename
}
Else {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment