Skip to content

Commit

Permalink
upgradinatorr.ps1 - Loop through each Lidarr media item before sendin…
Browse files Browse the repository at this point in the history
…g the request
  • Loading branch information
angrycuban13 committed Jan 3, 2025
1 parent e05b279 commit 368866a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Upgradinatorr/upgradinatorr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ function Start-StarrMediaSearch {
$body = "{`"name`":`"SeriesSearch`", `"seriesId`":$mediaId}"
}
"lidarr" {
$body = "{`"name`":`"ArtistSearch`", `"artistId`":[$mediaId]}"
$body = "{`"name`":`"ArtistSearch`", `"artistId`":$mediaId}"
}
}

Expand Down Expand Up @@ -1948,7 +1948,7 @@ foreach ($application in $applicationList) {
# Start the search for media items
if ($PSCmdlet.ShouldProcess($applicationName, "Starting search for media items")) {
# Sonarr's API only supports searching one series at a time, so we need to loop through each media item in $mediaToSearch
if ($applicationName -match 'sonarr') {
if ($applicationName -match 'sonarr|lidarr') {
foreach ($mediaItem in $mediaToSearch) {
Start-StarrMediaSearch -ApiKey $applicationConfiguration.ApiKey -ApiVersion $applicationConfiguration.ApiVersion -Application $applicationName -Media $mediaItem -Url $applicationConfiguration.Url
}
Expand Down

0 comments on commit 368866a

Please sign in to comment.