Skip to content

Commit

Permalink
fixed the check-plexaccess function
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 committed Mar 22, 2024
1 parent e9109c4 commit 0d2132d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PlexPosterMaker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ function Check-PlexAccess {
Write-Log -Message "Plex token found, checking access now..." -Path $configLogging -Type Info
if ((Invoke-WebRequest "$PlexUrl/library/sections/?X-Plex-Token=$PlexToken").StatusCode -eq 200) {
Write-Log -Subtext "Plex access is working..." -Path $configLogging -Type Success
[xml]$Libs = (Invoke-WebRequest "$PlexUrl/library/sections/?X-Plex-Token=$PlexToken").content
return (Invoke-WebRequest "$PlexUrl/library/sections/?X-Plex-Token=$PlexToken").content
}
Else {
Write-Log -Message "Could not access plex with this url: $PlexUrl/library/sections/?X-Plex-Token=$PlexToken" -Path $configLogging -Type Error
Expand All @@ -1723,7 +1723,7 @@ function Check-PlexAccess {
}
if ($result.StatusCode -eq 200) {
Write-Log -Subtext "Plex access is working..." -Path $configLogging -Type Success
[xml]$Libs = (Invoke-WebRequest "$PlexUrl/library/sections").content
return (Invoke-WebRequest "$PlexUrl/library/sections").content
}
}
}
Expand Down Expand Up @@ -2054,7 +2054,7 @@ foreach ($file in $files) {
CheckJsonPaths -font $font -backgroundfont $backgroundfont -titlecardfont $titlecardfont -Posteroverlay $Posteroverlay -Backgroundoverlay $Backgroundoverlay -titlecardoverlay $titlecardoverlay

# Check Plex now:
Check-PlexAccess -PlexUrl $PlexUrl -PlexToken $PlexToken
[xml]$Libs = Check-PlexAccess -PlexUrl $PlexUrl -PlexToken $PlexToken

# Check ImageMagick now:
Check-ImageMagick -magick $magick -magickinstalllocation $magickinstalllocation
Expand Down

0 comments on commit 0d2132d

Please sign in to comment.