Skip to content

Instantly share code, notes, and snippets.

@fragande
Last active February 22, 2024 03:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fragande/d2e58a751107fced36c8199e719f6b9d to your computer and use it in GitHub Desktop.
Save fragande/d2e58a751107fced36c8199e719f6b9d to your computer and use it in GitHub Desktop.
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