Skip to content

Commit

Permalink
feat: Add debug logging for Texless variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Aug 15, 2024
1 parent 9c3c640 commit 9e6e973
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions Posterizarr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[string]$mediatype
)

$CurrentScriptVersion = "1.3.3"
$CurrentScriptVersion = "1.3.4"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -675,6 +675,8 @@ function GetTMDBMoviePoster {
$NoLangPoster = ($response.images.posters | Where-Object iso_639_1 -eq $null)
}
if (!$NoLangPoster) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
if ($global:WidthHeightFilter -eq 'true') {
if ($global:TMDBVoteSorting -eq 'Primary') {
Expand Down Expand Up @@ -881,6 +883,8 @@ function GetTMDBMovieBackground {
$NoLangPoster = ($response.images.backdrops | Where-Object iso_639_1 -eq $null)
}
if (!$NoLangPoster) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
if ($global:WidthHeightFilter -eq 'true') {
if ($global:TMDBVoteSorting -eq 'Primary') {
Expand Down Expand Up @@ -1092,6 +1096,8 @@ function GetTMDBShowPoster {
$NoLangPoster = ($response.images.posters | Where-Object iso_639_1 -eq $null)
}
if (!$NoLangPoster) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
if ($global:WidthHeightFilter -eq 'true') {
if ($global:TMDBVoteSorting -eq 'Primary') {
Expand Down Expand Up @@ -1539,6 +1545,8 @@ function GetTMDBShowBackground {
$NoLangPoster = ($response.images.backdrops | Where-Object iso_639_1 -eq $null)
}
if (!$NoLangPoster) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
if ($global:WidthHeightFilter -eq 'true') {
if ($global:TMDBVoteSorting -eq 'Primary') {
Expand Down Expand Up @@ -1863,6 +1871,8 @@ function GetFanartMoviePoster {
$entrytemp = Get-FanartTv -Type movies -id $id -ErrorAction SilentlyContinue
if ($entrytemp -and $entrytemp.movieposter) {
if (!($entrytemp.movieposter | Where-Object lang -eq '00')) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
$global:posterurl = ($entrytemp.movieposter)[0].url
Write-Entry -Subtext "Found Poster with text on Fanart.tv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Blue -log Info
Expand Down Expand Up @@ -2003,6 +2013,8 @@ function GetFanartShowPoster {
$entrytemp = Get-FanartTv -Type tv -id $id -ErrorAction SilentlyContinue
if ($entrytemp -and $entrytemp.tvposter) {
if (!($entrytemp.tvposter | Where-Object lang -eq '00')) {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
$global:posterurl = ($entrytemp.tvposter)[0].url

Expand Down Expand Up @@ -2314,6 +2326,8 @@ function GetTVDBMoviePoster {
return $global:posterurl
}
Else {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
foreach ($lang in $global:PreferredLanguageOrderTVDB) {
if ($global:WidthHeightFilter -eq 'true'){
Expand Down Expand Up @@ -2619,6 +2633,8 @@ function GetTVDBShowPoster {
$global:TVDBAssetChangeUrl = "https://thetvdb.com/series/$($response.data.slug)#artwork"
}
Else {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
$global:posterurl = $defaultImageurl
Write-Entry -Subtext "Found Poster with text on TVDB" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Blue -log Info
Expand Down Expand Up @@ -2844,6 +2860,8 @@ function GetTVDBShowBackground {
$global:TVDBAssetChangeUrl = "https://thetvdb.com/series/$($response.data.slug)/#artwork"
}
Else {
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
if ($global:OnlyTextless -eq 'False') {
$global:posterurl = $defaultImageurl
Write-Entry -Subtext "Found background with text on TVDB" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Blue -log Info
Expand Down Expand Up @@ -3807,14 +3825,20 @@ $global:PreferredLanguageOrderTVDB = $global:PreferredLanguageOrder.Replace('xx'
if ($global:PreferredLanguageOrder.count -eq '1' -and $global:PreferredLanguageOrder -eq 'xx') {
$global:PreferTextless = $true
$global:OnlyTextless = $true
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
}
Elseif ($global:PreferredLanguageOrder[0] -eq 'xx') {
$global:PreferTextless = $true
$global:OnlyTextless = $false
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
}
Else {
$global:PreferTextless = $false
$global:OnlyTextless = $false
Write-Entry -Subtext "PreferTextless Value: $global:PreferTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "OnlyTextless Value: $global:OnlyTextless" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
}

# Season Lang Settings
Expand Down Expand Up @@ -3861,7 +3885,7 @@ $global:languageDirections = @{
"sk" = "LTR"; "sl" = "LTR"; "sq" = "LTR"; "sr" = "LTR"; "sv" = "LTR";
"sw" = "LTR"; "ta" = "LTR"; "te" = "LTR"; "th" = "LTR"; "tk" = "LTR";
"tr" = "LTR"; "ug" = "RTL"; "uk" = "LTR"; "ur" = "RTL"; "uz" = "LTR";
"vi" = "LTR"; "yo" = "LTR"; "zh" = "LTR"
"vi" = "LTR"; "yo" = "LTR"; "zh" = "LTR"; "xx" = "LTR"
}

# Plex Part
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.3
1.3.4

0 comments on commit 9e6e973

Please sign in to comment.