Skip to content

Commit

Permalink
fix: jellyfin ID query error
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Sep 25, 2024
1 parent 2238df6 commit abc73e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Posterizarr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ param (
[switch]$SyncEmby
)

$CurrentScriptVersion = "1.8.9"
$CurrentScriptVersion = "1.8.10"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -11494,13 +11494,20 @@ Elseif ($SyncJelly -or $SyncEmby){
foreach ($Season in $Seasons) {
$SeasonEpisodestemp = Invoke-RestMethod -Method Get -Uri "$OtherMediaServerUrl/shows/$($show.id)/Episodes?seasonid=$($Season.SeasonId)&api_key=$OtherMediaServerApiKey"
$SeasonEpisodes = $SeasonEpisodestemp.Items | Where-Object { $_.LocationType -eq 'FileSystem' } | Select-Object indexnumber, SeriesId, SeasonId, ImageTags, Id, Name -Unique

# Calculate the ShowID value
$ShowID = if ($SeasonEpisodes.SeriesId) { $SeasonEpisodes.SeriesId[0] -join ',' } else { $null }

# Calculate the SeasonId value
$SeasonId = if ($SeasonEpisodes.SeasonId) { $SeasonEpisodes.SeasonId[0] -join ',' } else { $null }

$tempseasondata = New-Object psobject
$tempseasondata | Add-Member -MemberType NoteProperty -Name "Library Name" -Value $show."Library Name"
$tempseasondata | Add-Member -MemberType NoteProperty -Name "Show Name" -Value $show.title
$tempseasondata | Add-Member -MemberType NoteProperty -Name "Show Original Name" -Value $show.OriginalTitle
$tempseasondata | Add-Member -MemberType NoteProperty -Name "Library Language" -Value $PreferredMetadataLanguage
$tempseasondata | Add-Member -MemberType NoteProperty -Name "ShowID" -Value $($SeasonEpisodes.SeriesId[0] -join ',')
$tempseasondata | Add-Member -MemberType NoteProperty -Name "SeasonId" -Value $($SeasonEpisodes.SeasonId[0] -join ',')
$tempseasondata | Add-Member -MemberType NoteProperty -Name "ShowID" -Value $ShowID
$tempseasondata | Add-Member -MemberType NoteProperty -Name "SeasonId" -Value $SeasonId
$tempseasondata | Add-Member -MemberType NoteProperty -Name "EpisodeIds" -Value $($SeasonEpisodes.id -join ',')
$tempseasondata | Add-Member -MemberType NoteProperty -Name "tvdbid" -Value $show.tvdbid
$tempseasondata | Add-Member -MemberType NoteProperty -Name "imdbid" -Value $show.imdbid
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.9
1.8.10

0 comments on commit abc73e3

Please sign in to comment.