From 4d6c1d67f266ffb47448b0c4d3f5bdf640bbd593 Mon Sep 17 00:00:00 2001 From: FSCorrupt <45659314+fscorrupt@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:12:23 +0100 Subject: [PATCH 1/4] Add: Skip AddText on Poster with Text --- Posterizarr.ps1 | 841 +++++++++++++++++++++++++++----------------- Release.txt | 2 +- config.example.json | 1 + 3 files changed, 513 insertions(+), 331 deletions(-) diff --git a/Posterizarr.ps1 b/Posterizarr.ps1 index a65a6c0..6c29e30 100644 --- a/Posterizarr.ps1 +++ b/Posterizarr.ps1 @@ -12,7 +12,7 @@ param ( [switch]$SyncEmby ) -$CurrentScriptVersion = "1.9.18" +$CurrentScriptVersion = "1.9.19" $global:HeaderWritten = $false $ProgressPreference = 'SilentlyContinue' @@ -3162,10 +3162,10 @@ function CheckJson { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Failed to read the existing configuration file." } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Failed to read config" } Exit @@ -3231,7 +3231,7 @@ function CheckJson { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong Main Attribute casing in config file" } Exit # Abort the script @@ -3258,7 +3258,7 @@ function CheckJson { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong Sub Attribute casing in config file" } Exit # Abort the script @@ -3282,7 +3282,7 @@ function CheckJson { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Config.json download failed." } Exit @@ -3293,7 +3293,7 @@ function CheckJson { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "$($_.Exception.Message)" } Exit @@ -3328,7 +3328,7 @@ function CheckJsonPaths { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "File missing" } Exit @@ -3405,7 +3405,7 @@ function CheckConfigFile { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Configure config file" } Exit @@ -3649,7 +3649,7 @@ function CheckPlexAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "No Plex Libs found" } Exit @@ -3664,7 +3664,7 @@ function CheckPlexAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Could not access plex" } Exit @@ -3677,7 +3677,7 @@ function CheckPlexAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Could not access plex" } Exit @@ -3697,7 +3697,7 @@ function CheckPlexAccess { } else { Write-Entry -Subtext "No libs on Plex, abort script now..." -Path $configLogging -Color Red -log Error - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "No libs on plex" } Exit @@ -3713,7 +3713,7 @@ function CheckPlexAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Could not access plex" } Exit @@ -3930,7 +3930,7 @@ function CheckJellyfinAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Clould not access jellyfin" } Exit @@ -3943,7 +3943,7 @@ function CheckJellyfinAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Clould not access jellyfin" } Exit @@ -3972,7 +3972,7 @@ function CheckEmbyAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Clould not access emby" } Exit @@ -3985,7 +3985,7 @@ function CheckEmbyAccess { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Clould not access emby" } Exit @@ -4041,7 +4041,7 @@ function UploadOtherMediaServerArtwork { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Unsupported image format" } exit @@ -4123,7 +4123,7 @@ function MassDownloadPlexArtwork { if ($lib.title -notmatch "^[^\/:*?`"<>\|\\}]+$") { Write-Entry -Message "Lib: '$($lib.title)' contains invalid characters." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error Write-Entry -Subtext "Please rename your lib and remove all chars that are listed here: '/, :, *, ?, `", <, >, |, \, or }'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Invalid lib chars" } Exit @@ -4136,7 +4136,7 @@ function MassDownloadPlexArtwork { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "No libs found" } Exit @@ -4287,7 +4287,8 @@ function MassDownloadPlexArtwork { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -4337,7 +4338,8 @@ function MassDownloadPlexArtwork { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -4366,7 +4368,7 @@ function MassDownloadPlexArtwork { if ($tmdbid.count -gt '1') { $tmdbid = $tmdbid[0] } if ($imdbid.count -gt '1') { $imdbid = $imdbid[0] } - if ($Metadata.MediaContainer.$contentquery.Label.tag){ + if ($Metadata.MediaContainer.$contentquery.Label.tag) { $Labels = $($Metadata.MediaContainer.$contentquery.Label.tag -join ',') } Else { @@ -4543,7 +4545,7 @@ function MassDownloadPlexArtwork { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Hashtable creation failed" } Exit @@ -4563,6 +4565,7 @@ function MassDownloadPlexArtwork { foreach ($entry in $AllMovies) { try { if ($($entry.RootFoldername)) { + $SkipingText = $false $global:posterurl = $null $global:ImageMagickError = $null $global:TMDBfallbackposterurl = $null @@ -4631,6 +4634,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -4745,6 +4749,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -4840,6 +4845,7 @@ function MassDownloadPlexArtwork { foreach ($entry in $AllShows) { if ($($entry.RootFoldername)) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -5037,6 +5043,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -5130,6 +5137,7 @@ function MassDownloadPlexArtwork { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { + $SkipingText = $false $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -5253,6 +5261,7 @@ function MassDownloadPlexArtwork { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -5286,6 +5295,7 @@ function MassDownloadPlexArtwork { $global:PlexTitleCardUrls = $episode."PlexTitleCardUrls".Split(",") $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -5815,7 +5825,7 @@ function MassDownloadPlexArtwork { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -5911,7 +5921,7 @@ function Send-UptimeKumaWebhook { [int]$ping = 0 ) - $uri = $global:UptimeKumaUrl+"?status=$status&msg=$msg&ping=$ping" + $uri = $global:UptimeKumaUrl + "?status=$status&msg=$msg&ping=$ping" try { $null = Invoke-RestMethod -Uri $uri Write-Entry -Message "Uptime Kuma webhook sent: Status=$status, Msg=$msg, Ping=$ping" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info @@ -5924,7 +5934,7 @@ function Send-UptimeKumaWebhook { ##### PRE-START ##### # Set Branch -if ($dev){ +if ($dev) { $Branch = 'dev' } Else { @@ -5973,7 +5983,7 @@ if ($Platform -ne 'Docker' -and $config.PrerequisitePart.AutoUpdatePosterizarr.t catch { Write-Entry -Subtext "Failed to download the latest script, Error: $($_.Exception.Message)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Script download failed" } Exit @@ -6022,7 +6032,7 @@ foreach ($folder in (Get-ChildItem -Path $(Join-Path $global:ScriptRoot $global: # Notification Part $global:SendNotification = $config.Notification.SendNotification.tolower() $global:UseUptimeKuma = $config.Notification.UseUptimeKuma.tolower() -if ($global:UseUptimeKuma -eq 'true'){ +if ($global:UseUptimeKuma -eq 'true') { $global:UptimeKumaUrl = $config.Notification.UptimeKumaUrl } @@ -6037,7 +6047,7 @@ if ($env:POWERSHELL_DISTRIBUTION_CHANNEL -like 'PSDocker*') { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Default notify url in config" } Exit @@ -6055,7 +6065,7 @@ Else { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Default notify url in config" } Exit @@ -6064,7 +6074,7 @@ Else { # API Part $global:tvdbapi = $config.ApiPart.tvdbapi -if ($global:tvdbapi -match '#'){ +if ($global:tvdbapi -match '#') { $global:tvdbpin = $global:tvdbapi.split('#')[1] $global:tvdbapi = $global:tvdbapi.split('#')[0] } @@ -6089,7 +6099,7 @@ $global:PreferredLanguageOrder = $config.ApiPart.PreferredLanguageOrder $global:PreferredSeasonLanguageOrder = $config.ApiPart.PreferredSeasonLanguageOrder $global:PreferredBackgroundLanguageOrder = $config.ApiPart.PreferredBackgroundLanguageOrder -if ($global:PreferredBackgroundLanguageOrder -eq 'PleaseFillMe'){ +if ($global:PreferredBackgroundLanguageOrder -eq 'PleaseFillMe') { $global:PreferredBackgroundLanguageOrder = $global:PreferredLanguageOrder } @@ -6230,7 +6240,7 @@ if ($enabledServers -gt 1) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Multiple media servers enabled" } Exit 0 @@ -6244,6 +6254,7 @@ $AssetPath = RemoveTrailingSlash $config.PrerequisitePart.AssetPath $BackupPath = RemoveTrailingSlash $config.PrerequisitePart.BackupPath $ManualAssetPath = RemoveTrailingSlash $config.PrerequisitePart.ManualAssetPath $Upload2Plex = $config.PrerequisitePart.PlexUpload.tolower() +$SkipAddText = $config.PrerequisitePart.SkipAddText.tolower() # Check if its a Network Share if ($AssetPath.StartsWith("\")) { @@ -6429,38 +6440,38 @@ if ($global:OSType -ne "Win32NT") { $global:OSarch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture if ($global:OSType -eq "Docker" -or $global:OSarch -eq "Arm64") { $magick = 'magick' - if ($AssetPath -match '^./'){ + if ($AssetPath -match '^./') { Write-Entry -Message "You have set your asset path to '$AssetPath', please change it to '/assets'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error Write-Entry -Subtext "Exiting Posterizarr now..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error # Clear Running File if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong asset path" } Exit 0 } - if ($BackupPath -match '^./'){ + if ($BackupPath -match '^./') { Write-Entry -Message "You have set your backup path to '$BackupPath', please change it to '/backuppath'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error Write-Entry -Subtext "Exiting Posterizarr now..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error # Clear Running File if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong backup path" } Exit 0 } - if ($ManualAssetPath -match '^./'){ + if ($ManualAssetPath -match '^./') { Write-Entry -Message "You have set your manualasset path to '$ManualAssetPath', please change it to '/manualassets'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error Write-Entry -Subtext "Exiting Posterizarr now..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error # Clear Running File if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong manual asset path" } Exit 0 @@ -6508,7 +6519,7 @@ if ($global:OSarch -eq "Arm64") { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Imagemagick missing" } Exit @@ -6608,7 +6619,7 @@ foreach ($path in $LogsPath, $TempPath, $TestPath, $AssetPath) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Default asset path" } Exit @@ -6632,7 +6643,7 @@ if ($ForceRunningDeletion -eq 'true') { if (Test-Path $CurrentlyRunning) { Write-Entry -Message "Another Posterizarr instance already running, exiting now..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning Write-Entry -Subtext "If its a false positive message you can manually delete the 'Posterizarr.Running' file in temp dir..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Warning - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Another instance running" } Exit @@ -6784,7 +6795,7 @@ if ($global:tmdbtoken.Length -le '35') { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Wrong TMDB token" } Exit @@ -6799,10 +6810,10 @@ while (-not $success -and $retryCount -lt $maxRetries) { try { # tvdb token Header $global:apiUrl = "https://api4.thetvdb.com/v4/login" - if ($global:tvdbpin){ + if ($global:tvdbpin) { $global:requestBody = @{ apikey = $global:tvdbapi - pin = $global:tvdbpin + pin = $global:tvdbpin } | ConvertTo-Json } Else { @@ -6843,7 +6854,7 @@ while (-not $success -and $retryCount -lt $maxRetries) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Could not receive a TVDB Token" } Exit @@ -6923,7 +6934,7 @@ if ($Manual) { if ($global:ImageProcessing -eq 'true') { if ($CreateSeasonPoster -eq 'y') { $Posteroverlay = $Seasonoverlay - if ($AddShowTitletoSeason -eq 'true'){ + if ($AddShowTitletoSeason -eq 'true') { if ($fontAllCaps -eq 'true') { $joinedTitle = $SeasonPosterName.ToUpper() } @@ -7011,9 +7022,9 @@ if ($Manual) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($AddText -eq 'true') { - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' - if ($AddShowTitletoSeason -eq 'true'){ - $ShowjoinedTitle = $ShowjoinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' + if ($AddShowTitletoSeason -eq 'true') { + $ShowjoinedTitle = $ShowjoinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { foreach ($symbol in $NewLineSymbols) { @@ -7048,7 +7059,7 @@ if ($Manual) { Else { $Arguments = "`"$PosterImage`" -gravity center -background None -layers Flatten `( -font `"$fontImagemagick`" -pointsize `"$optimalFontSize`" -fill `"$Seasonfontcolor`" -size `"$Seasonboxsize`" -background none -interline-spacing `"$SeasonlineSpacing`" -gravity south caption:`"$joinedTitle`" -trim +repage -extent `"$Seasonboxsize`" `) -gravity south -geometry +0`"$Seasontext_offset`" -quality $global:outputQuality -composite `"$PosterImage`"" } - if ($AddShowTitletoSeason -eq 'true'){ + if ($AddShowTitletoSeason -eq 'true') { # Show Part # Add Stroke if ($AddShowOnSeasonTextStroke -eq 'true') { @@ -7073,7 +7084,7 @@ if ($Manual) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - if ($AddShowTitletoSeason -eq 'true'){ + if ($AddShowTitletoSeason -eq 'true') { Write-Entry -Subtext " Applying showTitle text: `"$ShowjoinedTitle`"" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $logEntry = "`"$magick`" $ShowOnSeasonArguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append @@ -7107,7 +7118,7 @@ if ($Manual) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -7295,10 +7306,10 @@ Elseif ($Testing) { } # Optimal TitleCard EP Font Size if ($AddTitleCardEPText -eq 'true') { - $Episodetext = $Episodetext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $Episodetext = $Episodetext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $TitleCardoptimalFontSizeEpisodetext = Get-OptimalPointSize -text $Episodetext -font $titlecardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if ($global:IsTruncated) { $TruncatedCount++ } - $EpisodetextCAPS = $EpisodetextCAPS -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $EpisodetextCAPS = $EpisodetextCAPS -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $TitleCardoptimalFontSizeEpisodetextCAPS = Get-OptimalPointSize -text $EpisodetextCAPS -font $titlecardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if ($global:IsTruncated) { $TruncatedCount++ } } @@ -8230,7 +8241,7 @@ Elseif ($Testing) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -8309,7 +8320,8 @@ Elseif ($Tautulli) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -8357,7 +8369,8 @@ Elseif ($Tautulli) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -8386,7 +8399,7 @@ Elseif ($Tautulli) { if ($tmdbid.count -gt '1') { $tmdbid = $tmdbid[0] } if ($imdbid.count -gt '1') { $imdbid = $imdbid[0] } - if ($Metadata.MediaContainer.$contentquery.Label.tag){ + if ($Metadata.MediaContainer.$contentquery.Label.tag) { $Labels = $($Metadata.MediaContainer.$contentquery.Label.tag -join ',') } Else { @@ -8552,7 +8565,7 @@ Elseif ($Tautulli) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Hashtable creation failed" } Exit @@ -8569,10 +8582,11 @@ Elseif ($Tautulli) { try { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { + $SkipingText = $false $global:posterurl = $null $global:ImageMagickError = $null $global:TextlessPoster = $null @@ -8598,7 +8612,7 @@ Elseif ($Tautulli) { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -8616,7 +8630,7 @@ Elseif ($Tautulli) { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -8661,6 +8675,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -8687,7 +8702,7 @@ Elseif ($Tautulli) { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -8791,7 +8806,7 @@ Elseif ($Tautulli) { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -8831,8 +8846,14 @@ Elseif ($Tautulli) { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Poster from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -8868,12 +8889,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -8948,7 +8971,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $movietemp = New-Object psobject $movietemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $movietemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie' @@ -9009,7 +9032,7 @@ Elseif ($Tautulli) { if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -9027,7 +9050,7 @@ Elseif ($Tautulli) { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -9065,6 +9088,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -9091,7 +9115,7 @@ Elseif ($Tautulli) { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -9174,7 +9198,7 @@ Elseif ($Tautulli) { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $BackgroundImage | Out-Null } @@ -9214,8 +9238,14 @@ Elseif ($Tautulli) { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Background from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -9251,12 +9281,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $backgroundfontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -9332,7 +9364,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $moviebackgroundtemp = New-Object psobject $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie Background' @@ -9433,11 +9465,12 @@ Elseif ($Tautulli) { foreach ($entry in $AllShows) { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -9480,7 +9513,7 @@ Elseif ($Tautulli) { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -9498,7 +9531,7 @@ Elseif ($Tautulli) { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -9553,7 +9586,7 @@ Elseif ($Tautulli) { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -9641,7 +9674,7 @@ Elseif ($Tautulli) { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -9681,8 +9714,14 @@ Elseif ($Tautulli) { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Poster from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -9719,12 +9758,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -9799,7 +9840,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showtemp = New-Object psobject $showtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show' @@ -9859,7 +9900,7 @@ Elseif ($Tautulli) { if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -9877,7 +9918,7 @@ Elseif ($Tautulli) { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -9923,6 +9964,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -9950,7 +9992,7 @@ Elseif ($Tautulli) { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -10036,7 +10078,7 @@ Elseif ($Tautulli) { } } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $backgroundImage | Out-Null } @@ -10076,8 +10118,14 @@ Elseif ($Tautulli) { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Background from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -10113,12 +10161,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $backgroundfontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -10194,7 +10244,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showbackgroundtemp = New-Object psobject $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show Background' @@ -10270,6 +10320,7 @@ Elseif ($Tautulli) { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { + $SkipingText = $false $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -10307,7 +10358,7 @@ Elseif ($Tautulli) { $Testfile = "$global:season" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:season.jpg" } Else { @@ -10361,7 +10412,7 @@ Elseif ($Tautulli) { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Season Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -10491,7 +10542,7 @@ Elseif ($Tautulli) { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $SeasonImage | Out-Null } @@ -10572,14 +10623,16 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddSeasonText -eq 'true') { - $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { + $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($ShowOnSeasonfontAllCaps -eq 'true') { - $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } Else { - $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -10650,7 +10703,7 @@ Elseif ($Tautulli) { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $SeasonImage | Out-Null } @@ -10754,7 +10807,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $seasontemp = New-Object psobject $seasontemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($Titletext + " | " + $global:season) $seasontemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Season' @@ -10815,6 +10868,7 @@ Elseif ($Tautulli) { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -10851,6 +10905,7 @@ Elseif ($Tautulli) { if ($UseBackgroundAsTitleCard -eq 'true') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -10884,7 +10939,7 @@ Elseif ($Tautulli) { $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -10935,11 +10990,11 @@ Elseif ($Tautulli) { } Else { if ($PlexToken) { - $Arturl = $plexurl + $global:PlexTitleCardUrl + "?X-Plex-Token=$PlexToken" - } - Else { - $Arturl = $plexurl + $global:PlexTitleCardUrl - } + $Arturl = $plexurl + $global:PlexTitleCardUrl + "?X-Plex-Token=$PlexToken" + } + Else { + $Arturl = $plexurl + $global:PlexTitleCardUrl + } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { foreach ($ext in $allowedExtensions) { $filePath = "$ManualTestPath$ext" @@ -10950,7 +11005,7 @@ Elseif ($Tautulli) { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -11050,11 +11105,11 @@ Elseif ($Tautulli) { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } - if ($global:TempImagecopied -ne 'true'){ + if ($global:TempImagecopied -ne 'true') { Copy-Item -LiteralPath $EpisodeImage -destination $EpisodeTempImage | Out-Null } Write-Entry -Subtext "Copy local asset to: $EpisodeImage" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info @@ -11134,12 +11189,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick @@ -11168,11 +11225,14 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -11196,7 +11256,7 @@ Elseif ($Tautulli) { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage } @@ -11285,7 +11345,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -11349,6 +11409,7 @@ Elseif ($Tautulli) { } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -11385,7 +11446,7 @@ Elseif ($Tautulli) { $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -11440,7 +11501,7 @@ Elseif ($Tautulli) { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -11584,7 +11645,7 @@ Elseif ($Tautulli) { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } @@ -11650,12 +11711,14 @@ Elseif ($Tautulli) { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick @@ -11683,11 +11746,14 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -11710,7 +11776,7 @@ Elseif ($Tautulli) { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage } @@ -11799,7 +11865,7 @@ Elseif ($Tautulli) { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -11938,7 +12004,7 @@ Elseif ($Tautulli) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -11994,7 +12060,7 @@ Elseif ($SyncJelly -or $SyncEmby) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Lib contains invalid chars" } Exit @@ -12008,7 +12074,7 @@ Elseif ($SyncJelly -or $SyncEmby) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "No libs found" } Exit @@ -12159,7 +12225,8 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -12209,7 +12276,8 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -12238,7 +12306,7 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($tmdbid.count -gt '1') { $tmdbid = $tmdbid[0] } if ($imdbid.count -gt '1') { $imdbid = $imdbid[0] } - if ($Metadata.MediaContainer.$contentquery.Label.tag){ + if ($Metadata.MediaContainer.$contentquery.Label.tag) { $Labels = $($Metadata.MediaContainer.$contentquery.Label.tag -join ',') } Else { @@ -12325,12 +12393,12 @@ Elseif ($SyncJelly -or $SyncEmby) { $OtherAllLibs = Invoke-RestMethod -Method Get -Uri $allLibsquery write-Entry -Subtext "Found '$($OtherAllLibs.count)' libs and '$($LibstoExclude.count)' are excluded..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Info - $IncludedLibraryNames = ($OtherAllLibs | Where-Object {$_.Name -notin $LibstoExclude}).Name -join ', ' + $IncludedLibraryNames = ($OtherAllLibs | Where-Object { $_.Name -notin $LibstoExclude }).Name -join ', ' Write-Entry -Subtext "Included Libraries: $IncludedLibraryNames" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Info # Debug Output all Libs Write-Entry -Subtext "Media Server Lib overview..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug - Foreach ($lib in $OtherAllLibs){ + Foreach ($lib in $OtherAllLibs) { Write-Entry -Subtext "--------------------------------------------------" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext " Lib name: $($lib.name)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext " Lib Type: $($lib.CollectionType)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug @@ -12342,15 +12410,15 @@ Elseif ($SyncJelly -or $SyncEmby) { $OtherAllShows = @() $OtherAllEpisodes = @() - foreach ($otherlib in $OtherAllLibs){ + foreach ($otherlib in $OtherAllLibs) { if ($otherlib.Name -notin $LibstoExclude) { - if ($otherlib.CollectionType -eq 'movies'){ + if ($otherlib.CollectionType -eq 'movies') { Write-Entry -Subtext "Getting all Itmes from [$($otherlib.Name)] with item id [$($otherlib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug $allMoviesquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,OriginalTitle,Settings,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Movie" $Querytemp = Invoke-RestMethod -Method Get -Uri $allMoviesquery $OtherAllMovies += $Querytemp } - if ($otherlib.CollectionType -eq 'tvshows'){ + if ($otherlib.CollectionType -eq 'tvshows') { Write-Entry -Subtext "Getting all Itmes from [$($otherlib.Name)] with item id [$($otherlib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug $allShowsquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Series" $allEpisodesquery = "$OtherMediaServerUrl/Items?ParentId=$($otherlib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,Settings,Tags&IncludeItemTypes=Episode" @@ -12394,11 +12462,12 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } - if ($Movie.Tags){ + if ($Movie.Tags) { $Labels = $($Movie.Tags -join ',') } Else { @@ -12460,14 +12529,15 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } Write-Entry -Subtext "Matchedpath: $Matchedpath" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext "ExtractedFolder: $extractedFolder" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug } - if ($Movie.Tags){ + if ($Movie.Tags) { $Labels = $($Movie.Tags -join ',') } Else { @@ -12527,14 +12597,15 @@ Elseif ($SyncJelly -or $SyncEmby) { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } Write-Entry -Subtext "Matchedpath: $Matchedpath" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext "ExtractedFolder: $extractedFolder" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug - if ($Show.Tags){ + if ($Show.Tags) { $Labels = $($Show.Tags -join ',') } Else { @@ -12655,7 +12726,7 @@ Elseif ($SyncJelly -or $SyncEmby) { foreach ($entry in $AllMovies) { try { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { @@ -12725,7 +12796,7 @@ Elseif ($SyncJelly -or $SyncEmby) { foreach ($entry in $AllShows) { try { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { @@ -12963,7 +13034,7 @@ Elseif ($SyncJelly -or $SyncEmby) { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -12980,12 +13051,12 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $AllLibs = Invoke-RestMethod -Method Get -Uri $allLibsquery write-Entry -Subtext "Found '$($AllLibs.count)' libs and '$($LibstoExclude.count)' are excluded..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Info - $IncludedLibraryNames = ($AllLibs | Where-Object {$_.Name -notin $LibstoExclude}).Name -join ', ' + $IncludedLibraryNames = ($AllLibs | Where-Object { $_.Name -notin $LibstoExclude }).Name -join ', ' Write-Entry -Subtext "Included Libraries: $IncludedLibraryNames" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Info # Debug Output all Libs Write-Entry -Subtext "Media Server Lib overview..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug - Foreach ($lib in $AllLibs){ + Foreach ($lib in $AllLibs) { Write-Entry -Subtext "--------------------------------------------------" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext " Lib name: $($lib.name)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug Write-Entry -Subtext " Lib Type: $($lib.CollectionType)" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug @@ -12995,15 +13066,15 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $AllMovies = @() $AllShows = @() $AllEpisodes = @() - foreach ($slib in $AllLibs){ + foreach ($slib in $AllLibs) { if ($slib.Name -notin $LibstoExclude) { - if ($slib.CollectionType -eq 'movies'){ + if ($slib.CollectionType -eq 'movies') { Write-Entry -Subtext "Getting all Itmes from [$($slib.Name)] with item id [$($slib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug $allMoviesquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,OriginalTitle,Settings,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Movie" $Querytemp = Invoke-RestMethod -Method Get -Uri $allMoviesquery $AllMovies += $Querytemp } - if ($slib.CollectionType -eq 'tvshows'){ + if ($slib.CollectionType -eq 'tvshows') { Write-Entry -Subtext "Getting all Itmes from [$($slib.Name)] with item id [$($slib.ItemId)]" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug $allShowsquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,ProductionYear,Tags&IncludeItemTypes=Series" $allEpisodesquery = "$OtherMediaServerUrl/Items?ParentId=$($slib.ItemId)&api_key=$OtherMediaServerApiKey&Recursive=true&Fields=ProviderIds,SeasonUserData,OriginalTitle,Path,Overview,Settings,Tags&IncludeItemTypes=Episode" @@ -13048,12 +13119,13 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } - if ($Movie.Tags){ + if ($Movie.Tags) { $Labels = $($Movie.Tags -join ',') } Else { @@ -13116,12 +13188,13 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } - if ($Movie.Tags){ + if ($Movie.Tags) { $Labels = $($Movie.Tags -join ',') } Else { @@ -13186,12 +13259,13 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } - if ($Show.Tags){ + if ($Show.Tags) { $Labels = $($Show.Tags -join ',') } Else { @@ -13351,7 +13425,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Hashtable creation failed" } Exit @@ -13369,7 +13443,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer try { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { @@ -13396,7 +13470,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -13414,7 +13488,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -13455,6 +13529,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -13481,7 +13556,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -13575,7 +13650,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $joinedTitle = $Titletext } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -13603,8 +13678,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } Else { Write-Entry -Subtext "Downloading Poster from 'IMDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -13646,12 +13727,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { foreach ($symbol in $NewLineSymbols) { @@ -13703,7 +13786,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $movietemp = New-Object psobject $movietemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $movietemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie' @@ -13770,7 +13853,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -13788,7 +13871,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -13821,6 +13904,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -13847,7 +13931,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -13922,7 +14006,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $joinedTitle = $Titletext } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $backgroundImage | Out-Null } @@ -13950,8 +14034,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } Else { Write-Entry -Subtext "Downloading background from 'IMDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -13993,12 +14083,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { foreach ($symbol in $NewLineSymbols) { @@ -14051,7 +14143,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $moviebackgroundtemp = New-Object psobject $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie Background' @@ -14156,11 +14248,12 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer foreach ($entry in $AllShows) { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -14201,7 +14294,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -14219,7 +14312,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -14270,7 +14363,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -14335,7 +14428,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { $joinedTitle = $Titletext } - if (!$TakeLocal){ + if (!$TakeLocal) { if (!$global:TextlessPoster -eq 'True' -and $global:TMDBfallbackposterurl) { $global:posterurl = $global:TMDBfallbackposterurl } @@ -14344,7 +14437,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -14372,8 +14465,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } Else { Write-Entry -Subtext "Downloading Poster from 'IMDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -14416,12 +14515,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { foreach ($symbol in $NewLineSymbols) { @@ -14473,7 +14574,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showtemp = New-Object psobject $showtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show' @@ -14539,7 +14640,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -14557,7 +14658,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -14598,6 +14699,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -14625,7 +14727,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -14703,7 +14805,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $joinedTitle = $Titletext } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $backgroundImage | Out-Null } @@ -14731,8 +14833,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } Else { Write-Entry -Subtext "Downloading background from 'IMDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -14774,12 +14882,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { foreach ($symbol in $NewLineSymbols) { @@ -14832,7 +14942,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showbackgroundtemp = New-Object psobject $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show Background' @@ -14898,6 +15008,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:SeasonPosters -eq 'true') { # Loop through each Season foreach ($season in $Episodedata) { + $SkipingText = $false $global:IsFallback = $null $global:FallbackText = $null $global:AssetTextLang = $null @@ -14958,7 +15069,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $Testfile = "$global:season" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:season.jpg" } Else { @@ -15007,7 +15118,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Season Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -15124,7 +15235,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $SeasonImage | Out-Null } @@ -15198,14 +15309,16 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddSeasonText -eq 'true') { - $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { + $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($ShowOnSeasonfontAllCaps -eq 'true') { - $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } Else { - $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -15311,7 +15424,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $seasontemp = New-Object psobject $seasontemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($Titletext + " | " + $global:season) $seasontemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Season' @@ -15379,6 +15492,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -15414,6 +15528,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($UseBackgroundAsTitleCard -eq 'True') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -15445,7 +15560,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -15506,7 +15621,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -15581,11 +15696,11 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } - if ($global:TempImagecopied -ne 'true'){ + if ($global:TempImagecopied -ne 'true') { Copy-Item -LiteralPath $EpisodeImage -destination $EpisodeTempImage | Out-Null } Write-Entry -Subtext "Copy local asset to: $EpisodeImage" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info @@ -15656,12 +15771,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick } @@ -15684,11 +15801,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -15743,7 +15863,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -15813,6 +15933,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -15847,7 +15968,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -15898,7 +16019,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -16017,7 +16138,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($global:posterurl -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } @@ -16076,12 +16197,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick } @@ -16104,11 +16227,14 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -16161,7 +16287,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -16830,7 +16956,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } @@ -16860,7 +16986,7 @@ else { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Invalid chars on lib" } Exit @@ -16874,7 +17000,7 @@ else { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "No libs found" } Exit @@ -17025,7 +17151,8 @@ else { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -17075,7 +17202,8 @@ else { if ($pathSegments.Count -gt 2) { $extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file $extraFolder = $pathSegments[0] # All segments up to the extracted folder - } else { + } + else { $extractedFolder = $pathSegments[0] # Only one segment, it's the folder $extraFolder = $null # No parent structure } @@ -17104,7 +17232,7 @@ else { if ($tmdbid.count -gt '1') { $tmdbid = $tmdbid[0] } if ($imdbid.count -gt '1') { $imdbid = $imdbid[0] } - if ($Metadata.MediaContainer.$contentquery.Label.tag){ + if ($Metadata.MediaContainer.$contentquery.Label.tag) { $Labels = $($Metadata.MediaContainer.$contentquery.Label.tag -join ',') } Else { @@ -17282,7 +17410,7 @@ else { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "down" -msg "Hashtable creation failed" } Exit @@ -17302,10 +17430,11 @@ else { try { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { + $SkipingText = $false $global:posterurl = $null $global:ImageMagickError = $null $global:TMDBfallbackposterurl = $null @@ -17330,7 +17459,7 @@ else { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -17348,7 +17477,7 @@ else { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -17395,6 +17524,7 @@ else { $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -17422,7 +17552,7 @@ else { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -17526,7 +17656,7 @@ else { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -17566,8 +17696,14 @@ else { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Poster from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -17603,12 +17739,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -17685,7 +17823,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $movietemp = New-Object psobject $movietemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $movietemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie' @@ -17774,7 +17912,7 @@ else { if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -17792,7 +17930,7 @@ else { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -17831,6 +17969,7 @@ else { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -17858,7 +17997,7 @@ else { } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -17942,7 +18081,7 @@ else { } } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $BackgroundImage | Out-Null } @@ -17982,8 +18121,14 @@ else { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Background from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -18019,12 +18164,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $backgroundfontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -18102,7 +18249,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $moviebackgroundtemp = New-Object psobject $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $moviebackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Movie Background' @@ -18229,11 +18376,12 @@ else { foreach ($entry in $AllShows) { if ($($entry.RootFoldername)) { # check if item has skip label - if ($entry.labels -match 'skip_posterizarr'){ + if ($entry.labels -match 'skip_posterizarr') { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -18278,7 +18426,7 @@ else { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -18296,7 +18444,7 @@ else { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $PosterImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername).jpg" } Else { @@ -18352,7 +18500,7 @@ else { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -18444,7 +18592,7 @@ else { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $PosterImage | Out-Null } @@ -18484,8 +18632,14 @@ else { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading Poster with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless Poster from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Poster from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -18522,12 +18676,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $fontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -18604,7 +18760,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showtemp = New-Object psobject $showtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show' @@ -18692,7 +18848,7 @@ else { if ($global:BackgroundPosters -eq 'true') { if ($LibraryFolders -eq 'true') { $LibraryName = $entry.'Library Name' - if ($entry.extraFolder){ + if ($entry.extraFolder) { $EntryDir = "$AssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" $ManualEntryDir = "$ManualAssetPath\$LibraryName\$($entry.extraFolder)\$($entry.RootFoldername)" } @@ -18710,7 +18866,7 @@ else { } } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $backgroundImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_background.jpg" } Else { @@ -18757,6 +18913,7 @@ else { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables + $SkipingText = $false $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -18784,7 +18941,7 @@ else { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Background for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -18869,7 +19026,7 @@ else { $joinedTitle = $Titletext } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $BackgroundImage | Out-Null } @@ -18909,8 +19066,14 @@ else { } } elseif ($global:posterurl -like 'https://artworks.thetvdb.com*') { - Write-Entry -Subtext "Downloading background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info - $global:AssetTextLang = $global:TVDBAssetTextLang + if ($global:PosterWithText) { + Write-Entry -Subtext "Downloading background with Text from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } + Else { + Write-Entry -Subtext "Downloading Textless background from 'TVDB'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info + $global:AssetTextLang = $global:TVDBAssetTextLang + } } elseif ($global:posterurl -like "$PlexUrl*") { Write-Entry -Subtext "Downloading Background from 'Plex'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color DarkMagenta -log Info @@ -18946,12 +19109,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddBackgroundText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { $backgroundfontImagemagick = $RTLfontImagemagick } - $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $joinedTitle = $joinedTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -19029,7 +19194,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $showbackgroundtemp = New-Object psobject $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $Titletext $showbackgroundtemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Show Background' @@ -19133,6 +19298,7 @@ else { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { + $SkipingText = $false $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -19169,7 +19335,7 @@ else { $Testfile = "$global:season" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:season.jpg" } Else { @@ -19209,11 +19375,11 @@ else { $SeasonImage = $SeasonImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_') $checkedItems += $hashtestpath if ($PlexToken) { - $Arturl = $plexurl + $global:PlexSeasonUrl + "?X-Plex-Token=$PlexToken" - } - Else { - $Arturl = $plexurl + $global:PlexSeasonUrl - } + $Arturl = $plexurl + $global:PlexSeasonUrl + "?X-Plex-Token=$PlexToken" + } + Else { + $Arturl = $plexurl + $global:PlexSeasonUrl + } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { foreach ($ext in $allowedExtensions) { $filePath = "$ManualTestPath$ext" @@ -19223,7 +19389,7 @@ else { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Season Poster for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -19353,7 +19519,7 @@ else { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $SeasonImage } @@ -19434,14 +19600,16 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddSeasonText -eq 'true') { - $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { + $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($ShowOnSeasonfontAllCaps -eq 'true') { - $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext.ToUpper() -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } Else { - $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:ShowTitleOnSeason = $titletext -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' } # Loop through each symbol and replace it with a newline if ($NewLineOnSpecificSymbols -eq 'true') { @@ -19512,7 +19680,7 @@ else { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $SeasonImage } @@ -19618,7 +19786,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $seasontemp = New-Object psobject $seasontemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($Titletext + " | " + $global:season) $seasontemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Season' @@ -19707,6 +19875,7 @@ else { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -19743,6 +19912,7 @@ else { if ($UseBackgroundAsTitleCard -eq 'true') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -19776,7 +19946,7 @@ else { $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -19842,7 +20012,7 @@ else { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true $Episodepostersearchtext = $true @@ -19943,11 +20113,11 @@ else { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } - if ($global:TempImagecopied -ne 'true'){ + if ($global:TempImagecopied -ne 'true') { Copy-Item -LiteralPath $EpisodeImage -destination $EpisodeTempImage | Out-Null } Write-Entry -Subtext "Copy local asset to: $EpisodeImage" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info @@ -20026,12 +20196,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick @@ -20059,11 +20231,14 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -20087,7 +20262,7 @@ else { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage } @@ -20178,7 +20353,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -20270,6 +20445,7 @@ else { } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { + $SkipingText = $false $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -20306,7 +20482,7 @@ else { $Testfile = "$global:FileNaming" } Else { - if ($entry.extraFolder){ + if ($entry.extraFolder) { $SeasonImageoriginal = "$AssetPath\$($entry.extraFolder)\$($entry.RootFoldername)_$global:FileNaming.jpg" } Else { @@ -20362,7 +20538,7 @@ else { break } } - if (Test-Path -LiteralPath "$($Manualtestpath)$posterext"){ + if (Test-Path -LiteralPath "$($Manualtestpath)$posterext") { Write-Entry -Message "Found Manual Title Card for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info $TakeLocal = $true } @@ -20506,7 +20682,7 @@ else { } if ($global:posterurl -or $global:PlexartworkDownloaded -or $TakeLocal) { if ($global:ImageProcessing -eq 'true') { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } @@ -20572,12 +20748,14 @@ else { $logEntry = "`"$magick`" $Arguments" $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments - - if ($AddTitleCardEPTitleText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { $global:EPTitle = $global:EPTitle.ToUpper() } - $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:EPTitle = $global:EPTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' if ($global:direction -eq "RTL") { $TitleCardfontImagemagick = $RTLfontImagemagick } @@ -20587,7 +20765,7 @@ else { $global:EPTitle = $global:EPTitle -replace [regex]::Escape($symbol), "`n" } } - $joinedTitlePointSize = $global:EPTitle -replace '""', '""""' -replace '`','' + $joinedTitlePointSize = $global:EPTitle -replace '""', '""""' -replace '`', '' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPTitleMaxWidth -box_height $TitleCardEPTitleMaxHeight -min_pointsize $TitleCardEPTitleminPointSize -max_pointsize $TitleCardEPTitlemaxPointSize -lineSpacing $TitleCardEPTitlelineSpacing if (!$global:IsTruncated) { Write-Entry -Subtext "Optimal font size set to: '$optimalFontSize'" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info @@ -20605,11 +20783,14 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments } } - if ($AddTitleCardEPText -eq 'true') { + if ($SkipAddText -eq 'true' -and $global:PosterWithText) { + $SkipingText = $true + } + if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { $global:SeasonEPNumber = $global:SeasonEPNumber.ToUpper() } - $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`','' + $global:SeasonEPNumber = $global:SeasonEPNumber -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' $joinedTitlePointSize = $global:SeasonEPNumber -replace '""', '""""' $optimalFontSize = Get-OptimalPointSize -text $joinedTitlePointSize -font $TitleCardfontImagemagick -box_width $TitleCardEPMaxWidth -box_height $TitleCardEPMaxHeight -min_pointsize $TitleCardEPminPointSize -max_pointsize $TitleCardEPmaxPointSize -lineSpacing $TitleCardEPlineSpacing if (!$global:IsTruncated) { @@ -20632,7 +20813,7 @@ else { } } Else { - if ($TakeLocal){ + if ($TakeLocal) { Get-ChildItem -LiteralPath "$($ManualTestPath)$posterext" | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $EpisodeImage | Out-Null } @@ -20723,7 +20904,7 @@ else { Else { Write-Entry -Subtext "Skipping asset move because text is truncated..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } - if (!$TakeLocal){ + if (!$TakeLocal) { $episodetemp = New-Object psobject $episodetemp | Add-Member -MemberType NoteProperty -Name "Title" -Value $($global:FileNaming + " | " + $global:EPTitle) $episodetemp | Add-Member -MemberType NoteProperty -Name "Type" -Value 'Episode' @@ -21415,7 +21596,7 @@ else { if (Test-Path $CurrentlyRunning) { Remove-Item -LiteralPath $CurrentlyRunning | out-null } - if ($global:UptimeKumaUrl){ + if ($global:UptimeKumaUrl) { Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds } } \ No newline at end of file diff --git a/Release.txt b/Release.txt index f61b342..c503f0d 100644 --- a/Release.txt +++ b/Release.txt @@ -1 +1 @@ -1.9.18 \ No newline at end of file +1.9.19 \ No newline at end of file diff --git a/config.example.json b/config.example.json index 1b12159..c45232a 100644 --- a/config.example.json +++ b/config.example.json @@ -69,6 +69,7 @@ }, "PrerequisitePart": { "AssetPath": "P:\\assets", + "SkipAddText": "false", "ForceRunningDeletion": "false", "AutoUpdatePosterizarr": "false", "BackupPath": "P:\\assetsbackup", From 3461bb7b2d55f2275ddaba4bb196680313238903 Mon Sep 17 00:00:00 2001 From: FSCorrupt <45659314+fscorrupt@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:17:31 +0100 Subject: [PATCH 2/4] add: logging for SkipAddText --- Posterizarr.ps1 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Posterizarr.ps1 b/Posterizarr.ps1 index 6c29e30..dd11227 100644 --- a/Posterizarr.ps1 +++ b/Posterizarr.ps1 @@ -8891,6 +8891,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -9283,6 +9284,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -9760,6 +9762,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -10163,6 +10166,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -10625,6 +10629,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -11191,6 +11196,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -11227,6 +11233,7 @@ Elseif ($Tautulli) { } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -11713,6 +11720,7 @@ Elseif ($Tautulli) { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -11748,6 +11756,7 @@ Elseif ($Tautulli) { } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -13729,6 +13738,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -14085,6 +14095,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -14517,6 +14528,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -14884,6 +14896,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -15311,6 +15324,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -15773,6 +15787,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -15803,6 +15818,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -16199,6 +16215,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -16229,6 +16246,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -17741,6 +17759,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -18166,6 +18185,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -18678,6 +18698,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -19111,6 +19132,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -19602,6 +19624,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -20198,6 +20221,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -20233,6 +20257,7 @@ else { } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -20750,6 +20775,7 @@ else { InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -20785,6 +20811,7 @@ else { } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { $SkipingText = $true + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { From fda3db803254c5a262e8b1b4e0b1b6859dc7749a Mon Sep 17 00:00:00 2001 From: FSCorrupt <45659314+fscorrupt@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:38:15 +0100 Subject: [PATCH 3/4] Code adjustments and readme update --- Posterizarr.ps1 | 176 ++++++++++++++++++++++++------------------------ README.md | 1 + 2 files changed, 89 insertions(+), 88 deletions(-) diff --git a/Posterizarr.ps1 b/Posterizarr.ps1 index dd11227..4fe8cc6 100644 --- a/Posterizarr.ps1 +++ b/Posterizarr.ps1 @@ -4565,7 +4565,7 @@ function MassDownloadPlexArtwork { foreach ($entry in $AllMovies) { try { if ($($entry.RootFoldername)) { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:ImageMagickError = $null $global:TMDBfallbackposterurl = $null @@ -4634,7 +4634,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -4749,7 +4749,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -4845,7 +4845,7 @@ function MassDownloadPlexArtwork { foreach ($entry in $AllShows) { if ($($entry.RootFoldername)) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -5043,7 +5043,7 @@ function MassDownloadPlexArtwork { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -5137,7 +5137,7 @@ function MassDownloadPlexArtwork { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -5261,7 +5261,7 @@ function MassDownloadPlexArtwork { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -5295,7 +5295,7 @@ function MassDownloadPlexArtwork { $global:PlexTitleCardUrls = $episode."PlexTitleCardUrls".Split(",") $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -8586,7 +8586,7 @@ Elseif ($Tautulli) { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:ImageMagickError = $null $global:TextlessPoster = $null @@ -8675,7 +8675,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -8890,8 +8890,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -9089,7 +9089,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -9283,8 +9283,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -9472,7 +9472,7 @@ Elseif ($Tautulli) { } Else { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -9761,8 +9761,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -9967,7 +9967,7 @@ Elseif ($Tautulli) { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -10165,8 +10165,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -10324,7 +10324,7 @@ Elseif ($Tautulli) { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -10628,8 +10628,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -10873,7 +10873,7 @@ Elseif ($Tautulli) { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -10910,7 +10910,7 @@ Elseif ($Tautulli) { if ($UseBackgroundAsTitleCard -eq 'true') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -11195,8 +11195,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -11232,8 +11232,8 @@ Elseif ($Tautulli) { } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -11416,7 +11416,7 @@ Elseif ($Tautulli) { } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -11719,8 +11719,8 @@ Elseif ($Tautulli) { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -11755,8 +11755,8 @@ Elseif ($Tautulli) { } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -13538,7 +13538,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -13737,8 +13737,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -13914,7 +13914,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -14094,8 +14094,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -14264,7 +14264,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } Else { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -14527,8 +14527,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -14711,7 +14711,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -14895,8 +14895,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -15021,7 +15021,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:SeasonPosters -eq 'true') { # Loop through each Season foreach ($season in $Episodedata) { - $SkipingText = $false + $SkipingText = 'false' $global:IsFallback = $null $global:FallbackText = $null $global:AssetTextLang = $null @@ -15323,8 +15323,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -15506,7 +15506,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -15542,7 +15542,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer if ($UseBackgroundAsTitleCard -eq 'True') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -15786,8 +15786,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -15817,8 +15817,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -15949,7 +15949,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -16214,8 +16214,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -16245,8 +16245,8 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -17452,7 +17452,7 @@ else { Write-Entry -Message "Skipping '$($entry.title)' because it has a skip label..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Warning } Else { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:ImageMagickError = $null $global:TMDBfallbackposterurl = $null @@ -17542,7 +17542,7 @@ else { $checkedItems += $hashtestpath if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -17758,8 +17758,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -17988,7 +17988,7 @@ else { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -18184,8 +18184,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -18401,7 +18401,7 @@ else { } Else { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -18697,8 +18697,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -18934,7 +18934,7 @@ else { } if (-not $directoryHashtable.ContainsKey("$hashtestpath")) { # Define Global Variables - $SkipingText = $false + $SkipingText = 'false' $global:tmdbid = $entry.tmdbid $global:tvdbid = $entry.tvdbid $global:imdbid = $entry.imdbid @@ -19131,8 +19131,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddBackgroundText -eq 'true' -and $SkipingText -eq 'false') { if ($global:direction -eq "RTL") { @@ -19320,7 +19320,7 @@ else { $global:seasonNumbers = $entry.seasonNumbers -split ',' $global:PlexSeasonUrls = $entry.PlexSeasonUrls -split ',' for ($i = 0; $i -lt $global:seasonNames.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:posterurl = $null $global:IsFallback = $null $global:FallbackText = $null @@ -19623,8 +19623,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddSeasonText -eq 'true' -and $SkipingText -eq 'false') { $global:seasonTitle = $global:seasonTitle -replace '„', '"' -replace '”', '"' -replace '“', '"' -replace '"', '""' -replace '`', '' @@ -19898,7 +19898,7 @@ else { if ($global:TitleCards -eq 'true') { # Loop through each episode foreach ($episode in $Episodedata) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -19935,7 +19935,7 @@ else { if ($UseBackgroundAsTitleCard -eq 'true') { $global:ImageMagickError = $null for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -20220,8 +20220,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -20256,8 +20256,8 @@ else { } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { @@ -20470,7 +20470,7 @@ else { } Else { for ($i = 0; $i -lt $global:episode_numbers.Count; $i++) { - $SkipingText = $false + $SkipingText = 'false' $global:AssetTextLang = $null $global:TMDBAssetTextLang = $null $global:FANARTAssetTextLang = $null @@ -20774,8 +20774,8 @@ else { $logEntry | Out-File $global:ScriptRoot\Logs\ImageMagickCommands.log -Append InvokeMagickCommand -Command $magick -Arguments $Arguments if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPTitleText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPTitlefontAllCaps -eq 'true') { @@ -20810,8 +20810,8 @@ else { } } if ($SkipAddText -eq 'true' -and $global:PosterWithText) { - $SkipingText = $true - Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color White -log Info + $SkipingText = 'true' + Write-Entry -Subtext "Skipping 'AddText' because poster alreaedy has text." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info } if ($AddTitleCardEPText -eq 'true' -and $SkipingText -eq 'false') { if ($TitleCardEPfontAllCaps -eq 'true') { diff --git a/README.md b/README.md index 9bcb239..621d61b 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ Posterizarr is cross-platform ready, meaning it can run on Linux (also arm), [Do - `AssetPath`: Path to store generated posters. - `BackupPath`: Path to store/download Plex posters when using the [backup switch](#backup-mode). - `ManualAssetPath`: If assets are placed in this directory with the correct naming convention, they will be preferred. (it has to follow the same naming convention as you have in `/assets`) + - `SkipAddText`: If set to `true`, Posterizarr will skip adding text to the poster if it is flagged as a `Poster with text` by the provider. - `PlexUpload`: If set to `true`, Posterizarr will directly upload the artwork to Plex (handy if you do not use Kometa). - `ForceRunningDeletion`: If set to `true`, Posterizarr will automatically delete the Running File. - **Warning:** This may result in multiple concurrent runs sharing the same temporary directory, potentially causing image artifacts or unexpected behavior during processing. From 7b399d9104fab60d7db2a9fc7962d844957885f2 Mon Sep 17 00:00:00 2001 From: FSCorrupt <45659314+fscorrupt@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:57:24 +0100 Subject: [PATCH 4/4] add logging --- Posterizarr.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Posterizarr.ps1 b/Posterizarr.ps1 index 4fe8cc6..ac7c98c 100644 --- a/Posterizarr.ps1 +++ b/Posterizarr.ps1 @@ -3498,6 +3498,7 @@ function LogConfigSettings { Write-Entry -Subtext "Prerequisites Part" -Path $configLogging -Color Cyan -log Info Write-Entry -Subtext "| Asset Path: $AssetPath" -Path $configLogging -Color White -log Info Write-Entry -Subtext "| Backup Path: $BackupPath" -Path $configLogging -Color White -log Info + Write-Entry -Subtext "| Skip adding Text: $SkipAddText" -Path $configLogging -Color White -log Info Write-Entry -Subtext "| Manual Asset Path: $ManualAssetPath" -Path $configLogging -Color White -log Info Write-Entry -Subtext "| Upload to Plex: $Upload2Plex" -Path $configLogging -Color White -log Info Write-Entry -Subtext "| Show skipped: $show_skipped" -Path $configLogging -Color White -log Info