Skip to content

Commit

Permalink
Merge pull request #75 from bullmoose20/main
Browse files Browse the repository at this point in the history
extra logging and try 1 for hashtestpath with relative paths
  • Loading branch information
fscorrupt authored Mar 25, 2024
2 parents 4b479ea + b440213 commit 2895877
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 17 deletions.
61 changes: 45 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.35"
$CurrentScriptVersion = "1.0.36"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -2122,6 +2122,14 @@ Log-ConfigSettings
# Starting main Script now...
Write-Log -Message "Starting main Script now..." -Path $configLogging -Type Success

# Fix asset path based on OS (do it here so that we see what is in config.json versus what script should use)
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$AssetPath = $AssetPath.Replace('\', '/')
}
else {
$AssetPath = $AssetPath.Replace('/', '\')
}

# Get files in script root with specified extensions
$files = Get-ChildItem -Path $global:ScriptRoot -File | Where-Object { $_.Extension -in $fileExtensions } -ErrorAction SilentlyContinue

Expand Down Expand Up @@ -3367,8 +3375,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$PosterImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername).jpg"
Expand Down Expand Up @@ -3573,8 +3584,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$backgroundImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_background.jpg"
Expand Down Expand Up @@ -3814,8 +3828,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$PosterImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername).jpg"
Expand Down Expand Up @@ -4028,8 +4045,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$backgroundImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_background.jpg"
Expand Down Expand Up @@ -4246,8 +4266,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$SeasonImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_$global:season.jpg"
Expand Down Expand Up @@ -4532,8 +4555,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$EpisodeImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_$global:FileNaming.jpg"
Expand Down Expand Up @@ -4805,8 +4831,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = $TestPath + "\" + $Testfile
else {
$fullTestPath = Resolve-Path -Path $TestPath -ErrorAction SilentlyContinue
if ($fullTestPath) {
$hashtestpath = ($fullTestPath.Path + "\" + $Testfile).Replace('/', '\')
}
}

$EpisodeImage = Join-Path -Path $global:ScriptRoot -ChildPath "temp\$($entry.RootFoldername)_$global:FileNaming.jpg"
Expand Down Expand Up @@ -5323,4 +5352,4 @@ else {
Push-ObjectToDiscord -strDiscordWebhook $global:NotifyUrl -objPayload $jsonPayload
}
}
}
}
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.35
1.0.36

0 comments on commit 2895877

Please sign in to comment.