Skip to content

Commit

Permalink
fix show_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Mar 24, 2024
1 parent 1007b63 commit 5726dc1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions PlexPosterMaker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param (
[switch]$Testing
)

$CurrentScriptVersion = "1.0.31"
$CurrentScriptVersion = "1.0.32"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -1948,7 +1948,7 @@ if (!$global:FavProvider) {
$LibstoExclude = $config.PlexPart.LibstoExclude
$PlexUrl = $config.PlexPart.PlexUrl
# Prerequisites Part
$show_missing = $config.PrerequisitePart.show_missing
$show_skipped = $config.PrerequisitePart.show_skipped
$AssetPath = RemoveTrailingSlash $config.PrerequisitePart.AssetPath

# Check if its a Network Share
Expand Down Expand Up @@ -3364,7 +3364,7 @@ else {
$PosterImage = $PosterImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')
# Now we can start the Poster Part
if ($global:Posters -eq 'true') {
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
# Define Global Variables
$global:tmdbid = $entry.tmdbid
$global:tvdbid = $entry.tvdbid
Expand Down Expand Up @@ -3534,7 +3534,7 @@ else {
}
}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$PosterImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand All @@ -3561,7 +3561,7 @@ else {
$backgroundImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_background.jpg"
$backgroundImage = $backgroundImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')

if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
# Define Global Variables
$global:tmdbid = $entry.tmdbid
$global:tvdbid = $entry.tvdbid
Expand Down Expand Up @@ -3724,7 +3724,7 @@ else {
}
}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$backgroundImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand Down Expand Up @@ -3798,7 +3798,7 @@ else {
}
# Now we can start the Poster Part
if ($global:Posters -eq 'true') {
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
Write-Log -Message "Start Poster Search for: $Titletext" -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Info
switch -Wildcard ($global:FavProvider) {
'TMDB' { if ($entry.tmdbid) { $global:posterurl = GetTMDBShowPoster }Else { Write-Log -Subtext "Can't search on TMDB, missing ID..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Warning; $global:posterurl = GetFanartShowPoster } }
Expand Down Expand Up @@ -3964,7 +3964,7 @@ else {

}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$PosterImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand All @@ -3990,7 +3990,7 @@ else {

$backgroundImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_background.jpg"
$backgroundImage = $backgroundImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
# Define Global Variables
$global:tmdbid = $entry.tmdbid
$global:tvdbid = $entry.tvdbid
Expand Down Expand Up @@ -4157,7 +4157,7 @@ else {
}
}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$backgroundImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand Down Expand Up @@ -4194,7 +4194,7 @@ else {
}
$SeasonImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_$global:season.jpg"
$SeasonImage = $SeasonImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
if ($PlexToken) {
$Arturl = $plexurl + $global:PlexSeasonUrl + "?X-Plex-Token=$PlexToken"
}
Expand Down Expand Up @@ -4411,7 +4411,7 @@ else {
}
}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$SeasonImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand Down Expand Up @@ -4472,7 +4472,7 @@ else {
$EpisodeImage = $EpisodeImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')

$EpisodeTempImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\temp.jpg"
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
if (!$Episodepostersearchtext) {
Write-Log -Message "Start Title Card Search for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Info
$Episodepostersearchtext = $true
Expand Down Expand Up @@ -4695,7 +4695,7 @@ else {

}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$EpisodeImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand Down Expand Up @@ -4734,7 +4734,7 @@ else {
}
$EpisodeImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_$global:FileNaming.jpg"
$EpisodeImage = $EpisodeImage.Replace('[', '_').Replace(']', '_').Replace('{', '_').Replace('}', '_')
if (!$directoryHashtable.ContainsKey($Testfile)) {
if (-not $directoryHashtable.Keys -like "$TestPath\$Testfile*") {
if (!$Episodepostersearchtext) {
Write-Log -Message "Start Title Card Search for: $global:show_name - $global:SeasonEPNumber" -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Info
$Episodepostersearchtext = $true
Expand Down Expand Up @@ -4997,7 +4997,7 @@ else {

}
Else {
if ($show_missing -eq 'True' ) {
if ($show_skipped -eq 'True' ) {
Write-Log -Subtext "Skipping '$EpisodeImageoriginal' because it already exists..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Trace
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Plex Poster Maker is cross-platform ready, meaning it can run on Linux, Docker (
<br>

- `AssetPath`: Path to store generated posters.
- `show_missing`: If set to `true`, verbose logging of already created assets will be displayed; otherwise, they will be silently skipped - On large libraries, this may appear as if the script is hanging.
- `show_skipped`: If set to `true`, verbose logging of already created assets will be displayed; otherwise, they will be silently skipped - On large libraries, this may appear as if the script is hanging.
- `magickinstalllocation`: Path to ImageMagick installation location where `magick.exe` is located (Otherwise leave value as `"./magick"`)
- `maxLogs`: Number of Log folders you want to keep in `RotatedLogs` Folder (Log History).
- `font`: Font file name.
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.31
1.0.32
2 changes: 1 addition & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"PrerequisitePart":{
"AssetPath": "P:\\assets",
"show_missing":"false",
"show_skipped":"false",
"magickinstalllocation": "C:\\PosterTemp\\ImageMagickPortable",
"maxLogs": "5",
"font": "Rocky.ttf",
Expand Down

0 comments on commit 5726dc1

Please sign in to comment.