From 534d5f7177c72c82ade077160278f656683b2755 Mon Sep 17 00:00:00 2001 From: causefx Date: Sat, 27 May 2017 15:18:32 -0700 Subject: [PATCH] Fix Plex Error on Homepage was not an array, its an XML object --- functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index ff0ee1886..e6eb63eda 100755 --- a/functions.php +++ b/functions.php @@ -584,10 +584,10 @@ function getPlexStreams($size){ $address = qualifyURL(PLEXURL); // Perform API requests - $api = file_get_contents($address."/status/sessions?X-Plex-Token=".PLEXTOKEN); + $api = @file_get_contents($address."/status/sessions?X-Plex-Token=".PLEXTOKEN); $api = simplexml_load_string($api); $getServer = simplexml_load_string(@file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN)); - if (!is_array($getServer)) { return 'Could not load!'; } + if (!$getServer) { return 'Could not load!'; } // Identify the local machine $gotServer = $getServer['machineIdentifier']; @@ -686,10 +686,10 @@ function getPlexRecent($type, $size){ } // Perform Requests - $api = file_get_contents($address."/library/recentlyAdded?X-Plex-Token=".PLEXTOKEN); + $api = @file_get_contents($address."/library/recentlyAdded?X-Plex-Token=".PLEXTOKEN); $api = simplexml_load_string($api); $getServer = simplexml_load_string(@file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN)); - if (!is_array($getServer)) { return 'Could not load!'; } + if (!$getServer) { return 'Could not load!'; } // Identify the local machine $gotServer = $getServer['machineIdentifier'];