Last active
February 22, 2024 03:39
-
-
Save fragande/d2e58a751107fced36c8199e719f6b9d to your computer and use it in GitHub Desktop.
Simple PowerShell script for BurntToast Sonarr notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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