Skip to content

Commit

Permalink
fix plex folder query
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Mar 27, 2024
1 parent f68df7b commit 213e0e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 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.45"
$CurrentScriptVersion = "1.0.46"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -3273,16 +3273,17 @@ else {
Write-Entry -Subtext "Location: $location" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "Libpath: $libpath" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
$Matchedpath = AddTrailingSlash $libpath
$extractedFolder = $location.Substring($Matchedpath.Length)
if ($extractedFolder -like "*\*") {
$extractedFolder = $extractedFolder.Split("\")[0]
$libpath = $Matchedpath
$extractedFolder = $location.Substring($libpath.Length)
if ($extractedFolder -like '*\*') {
$extractedFolder = $extractedFolder.split('\')[0]
}
elseif ($extractedFolder -like "*/*") {
$extractedFolder = $extractedFolder.Split("/")[0]
if ($extractedFolder -like '*/*') {
$extractedFolder = $extractedFolder.split('/')[0]
}
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
break # Exit loop once a match is found
break
}
}
}
Expand Down Expand Up @@ -3316,6 +3317,7 @@ else {
}
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
break
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.45
1.0.46

1 comment on commit 213e0e2

@fscorrupt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#77

Please sign in to comment.