Skip to content

Commit

Permalink
fix where the assetpath by OS var is cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 committed Mar 25, 2024
1 parent 7a30aed commit c28278a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions PlexPosterMaker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1951,13 +1951,6 @@ $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 @@ -2129,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

0 comments on commit c28278a

Please sign in to comment.