Skip to content

Commit

Permalink
fix: pathsegment -gt value
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Dec 21, 2024
1 parent 05ecf2d commit 232e385
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Posterizarr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4284,7 +4284,7 @@ function MassDownloadPlexArtwork {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -4334,7 +4334,7 @@ function MassDownloadPlexArtwork {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -8305,7 +8305,7 @@ Elseif ($Tautulli) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -8353,7 +8353,7 @@ Elseif ($Tautulli) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -12145,7 +12145,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -12195,7 +12195,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -12380,7 +12380,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -12446,7 +12446,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -12513,7 +12513,7 @@ Elseif ($SyncJelly -or $SyncEmby) {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -13034,7 +13034,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -13102,7 +13102,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -13172,7 +13172,7 @@ Elseif ($OtherMediaServerUrl -and $OtherMediaServerApiKey -and $UseOtherMediaSer
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -16997,7 +16997,7 @@ else {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -17047,7 +17047,7 @@ else {
$pathSegments = $relativePath -split '[\\/]'

# Determine the extracted folder and the root folder path
if ($pathSegments.Count -gt 1) {
if ($pathSegments.Count -gt 2) {
$extractedFolder = $pathSegments[-2] # Second-to-last segment is the folder containing the file
$extraFolder = $pathSegments[0] # All segments up to the extracted folder
} else {
Expand Down Expand Up @@ -21380,4 +21380,4 @@ else {
if ($global:UptimeKumaUrl){
Send-UptimeKumaWebhook -status "up" -ping $executionTime.TotalMilliseconds
}
}
}

0 comments on commit 232e385

Please sign in to comment.