Skip to content

Commit

Permalink
Merge pull request #66 from angrycuban13/sonarr_unattended_fix
Browse files Browse the repository at this point in the history
Fixing Sonarr search issue when running unattended
  • Loading branch information
angrycuban13 authored May 21, 2024
2 parents 7c9fe30 + c00c62a commit a005fb0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Upgradinatorr/upgradinatorr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ foreach ($app in $apps) {
Send-DiscordMessage @discordMessageParams
}

Write-Host "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"
Write-Output "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"
}
}

Expand Down Expand Up @@ -1507,7 +1507,7 @@ foreach ($app in $apps) {
Send-DiscordMessage @discordMessageParams
}

Write-Host "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"
Write-Output "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"

}
}
Expand Down Expand Up @@ -1585,9 +1585,8 @@ foreach ($app in $apps) {
Write-Verbose "Filtered series to $($filteredSeries.Count) series from $app"
}

if ($filteredMovies.Count -eq 0) {
if ($filteredSeries.Count -eq 0) {
if ($sendDiscordNotification) {
$movieTitleList = $mediaToSearch.title | ForEach-Object { "* $_" }
$messageDescription = "No series left to search, is the ignore tag applied to all series?`n* Tag Name: `"$ignoreTag`"`n* Tag ID: `"$($ignoreTagId)`" "

$discordMessageParams = @{
Expand Down Expand Up @@ -1647,7 +1646,7 @@ foreach ($app in $apps) {
Send-DiscordMessage @discordMessageParams
}

Write-Host "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"
Write-Output "Upgradinatorr kicked off search for: `n$($seriesTitleList -join `"`n`")"

}

Expand Down Expand Up @@ -1678,7 +1677,7 @@ foreach ($app in $apps) {
Search-Media -App $app -ApiKey $apiKey -ApiVersion $apiVersion -Media $seriesToSearch -Url $url
}

Write-Output "Adding tag name `"$tagName`" to $($mediaToSearch.Count) series in $app"
Write-Output "Adding tag name `"$tagName`" to $($mediaToSearch.Count) series in $app"

Add-TagToMedia -App $app -ApiKey $apiKey -ApiVersion $apiVersion -Media $mediaToSearch -TagId $tagId -Url $url

Expand All @@ -1704,8 +1703,7 @@ foreach ($app in $apps) {
Send-DiscordMessage @discordMessageParams
}

Write-Host "Upgradinatorr kicked off search for: `n$($movieTitleList -join `"`n`")"

Write-Output "Upgradinatorr kicked off search for: `n$($seriesTitleList -join `"`n`")"
}
}

Expand Down

0 comments on commit a005fb0

Please sign in to comment.