Skip to content

Commit

Permalink
fix for fullpath
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 committed Mar 25, 2024
1 parent 03d3c27 commit 7a30aed
Showing 1 changed file with 42 additions and 14 deletions.
56 changes: 42 additions & 14 deletions PlexPosterMaker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,13 @@ $PlexUrl = $config.PlexPart.PlexUrl
$show_skipped = $config.PrerequisitePart.show_skipped
$AssetPath = RemoveTrailingSlash $config.PrerequisitePart.AssetPath

if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$AssetPath = $AssetPath.Replace('\', '/')
}
else {
$AssetPath = $AssetPath.Replace('/', '\')
}

# Check if its a Network Share
if ($AssetPath.StartsWith("\")) {
# add \ if it only Starts with one
Expand Down Expand Up @@ -3369,8 +3376,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -3575,8 +3585,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -3816,8 +3829,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -4030,8 +4046,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -4248,8 +4267,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -4534,8 +4556,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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 @@ -4807,8 +4832,11 @@ else {
if ($Platform -eq 'Docker' -or $Platform -eq 'Linux') {
$hashtestpath = ($TestPath + "/" + $Testfile).Replace('\', '/')
}
Else {
$hashtestpath = ($TestPath + "\" + $Testfile).Replace('/', '\')
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

0 comments on commit 7a30aed

Please sign in to comment.