Skip to content

Commit 78fe15c

Browse files
authored
fix: jelly/emby sync (#156)
2 parents 88a5401 + 4348402 commit 78fe15c

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

Posterizarr.ps1

+21-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param (
1212
[switch]$SyncEmby
1313
)
1414

15-
$CurrentScriptVersion = "1.9.1"
15+
$CurrentScriptVersion = "1.9.2"
1616
$global:HeaderWritten = $false
1717
$ProgressPreference = 'SilentlyContinue'
1818

@@ -11814,9 +11814,6 @@ Elseif ($SyncJelly -or $SyncEmby) {
1181411814
$PreferredMetadataLanguage = (Invoke-RestMethod -Method Get -Uri "$OtherMediaServerUrl/System/Configuration?api_key=$OtherMediaServerApiKey").PreferredMetadataLanguage
1181511815
$allLibsquery = "$OtherMediaServerUrl/Library/VirtualFolders?api_key=$OtherMediaServerApiKey"
1181611816
$OtherAllLibs = Invoke-RestMethod -Method Get -Uri $allLibsquery
11817-
$OtherAllEpisodes = $null
11818-
$OtherAllShows = $null
11819-
$OtherAllMovies = $null
1182011817

1182111818
write-Entry -Subtext "Found '$($OtherAllLibs.count)' libs and '$($LibstoExclude.count)' are excluded..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Info
1182211819
$IncludedLibraryNames = ($OtherAllLibs | Where-Object {$_.Name -notin $LibstoExclude}).Name -join ', '
@@ -11832,19 +11829,26 @@ Elseif ($SyncJelly -or $SyncEmby) {
1183211829
Write-Entry -Subtext "--------------------------------------------------" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1183311830
}
1183411831

11832+
$OtherAllMovies = @()
11833+
$OtherAllShows = @()
11834+
$OtherAllEpisodes = @()
11835+
1183511836
foreach ($otherlib in $OtherAllLibs){
1183611837
if ($otherlib.Name -notin $LibstoExclude) {
1183711838
if ($otherlib.CollectionType -eq 'movies'){
1183811839
Write-Entry -Subtext "Getting all Itmes from [$($otherlib.Name)] with item id [$($otherlib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1183911840
$allMoviesquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,OriginalTitle,Settings,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Movie"
11840-
$OtherAllMovies += Invoke-RestMethod -Method Get -Uri $allMoviesquery
11841+
$Querytemp = Invoke-RestMethod -Method Get -Uri $allMoviesquery
11842+
$OtherAllMovies += $Querytemp
1184111843
}
1184211844
if ($otherlib.CollectionType -eq 'tvshows'){
1184311845
Write-Entry -Subtext "Getting all Itmes from [$($otherlib.Name)] with item id [$($otherlib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1184411846
$allShowsquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Series"
1184511847
$allEpisodesquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,Settings,Tags&IncludeItemTypes=Episode"
11846-
$OtherAllShows += Invoke-RestMethod -Method Get -Uri $allShowsquery
11847-
$OtherAllEpisodes += Invoke-RestMethod -Method Get -Uri $allEpisodesquery
11848+
$Querytempshow = Invoke-RestMethod -Method Get -Uri $allShowsquery
11849+
$QuerytempEpisodes = Invoke-RestMethod -Method Get -Uri $allEpisodesquery
11850+
$OtherAllShows += $Querytempshow
11851+
$OtherAllEpisodes += $QuerytempEpisodes
1184811852
}
1184911853
}
1185011854
}
@@ -12122,6 +12126,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
1212212126
# START HERE
1212312127
Write-Entry -Message "Starting artwork sync now, this can take a while..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info
1212412128
Write-Entry -Message "Starting movie artwork sync part..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info
12129+
pause
1212512130
# Movie Part
1212612131
foreach ($entry in $AllMovies) {
1212712132
try {
@@ -12460,20 +12465,25 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer
1246012465
Write-Entry -Subtext " Lib locations: $($lib.Locations)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1246112466
Write-Entry -Subtext "--------------------------------------------------" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1246212467
}
12463-
12468+
$AllMovies = @()
12469+
$AllShows = @()
12470+
$AllEpisodes = @()
1246412471
foreach ($slib in $AllLibs){
1246512472
if ($slib.Name -notin $LibstoExclude) {
1246612473
if ($slib.CollectionType -eq 'movies'){
1246712474
Write-Entry -Subtext "Getting all Itmes from [$($slib.Name)] with item id [$($slib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1246812475
$allMoviesquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,OriginalTitle,Settings,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Movie"
12469-
$AllMovies += Invoke-RestMethod -Method Get -Uri $allMoviesquery
12476+
$Querytemp = Invoke-RestMethod -Method Get -Uri $allMoviesquery
12477+
$AllMovies += $Querytemp
1247012478
}
1247112479
if ($slib.CollectionType -eq 'tvshows'){
1247212480
Write-Entry -Subtext "Getting all Itmes from [$($slib.Name)] with item id [$($slib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
1247312481
$allShowsquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Series"
1247412482
$allEpisodesquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,Settings,Tags&IncludeItemTypes=Episode"
12475-
$AllShows += Invoke-RestMethod -Method Get -Uri $allShowsquery
12476-
$AllEpisodes += Invoke-RestMethod -Method Get -Uri $allEpisodesquery
12483+
$Querytempshow = Invoke-RestMethod -Method Get -Uri $allShowsquery
12484+
$QuerytempEpisodes = Invoke-RestMethod -Method Get -Uri $allEpisodesquery
12485+
$AllShows += $Querytempshow
12486+
$AllEpisodes += $QuerytempEpisodes
1247712487
}
1247812488
}
1247912489
}

Release.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.1
1+
1.9.2

0 commit comments

Comments
 (0)