diff --git a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php index da1d4ee4f..4996d8525 100644 --- a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php +++ b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php @@ -21,51 +21,6 @@ connect-user-profile { // Set the path for the local manifest file $localManifestFile = '/usr/local/emhttp/plugins/dynamix.my.servers/connect-components/manifest.json'; -// Define the remote resource URL -$remoteResourceUrl = 'https://components.myunraid.com/'; - -// Check if session cookie exists -if (!isset($_COOKIE['manifest_last_checked']) || time() - $_COOKIE['manifest_last_checked'] >= 300) { - // Get the remote manifest JSON - $remoteManifestJson = file_get_contents($remoteResourceUrl . 'manifest.json'); - - // Compare the remote and local manifest versions - $remoteManifest = json_decode($remoteManifestJson, true); - $localManifest = json_decode(file_get_contents($localManifestFile), true); - - if ($remoteManifest && $localManifest && $remoteManifest !== $localManifest) { - // Update the local manifest - file_put_contents($localManifestFile, $remoteManifestJson); - - // Download the file contents for the search value - $searchText = 'connect-components.client.mjs'; - $fileValue = null; - - foreach ($remoteManifest as $key => $value) { - if (strpos($key, $searchText) !== false && isset($value["file"])) { - $fileValue = file_get_contents($remoteResourceUrl . $value["file"]); - break; - } - } - - if ($fileValue !== null) { - // Extract the directory path from the URL - $directoryPath = pathinfo($value["file"], PATHINFO_DIRNAME); - // Set the local file path - $localFilePath = '/usr/local/emhttp/plugins/dynamix.my.servers' . $directoryPath; - // Create the directory if it doesn't exist - if (!is_dir($localFilePath)) { - mkdir($localFilePath, 0777, true); - } - // Save the file contents to a local file - file_put_contents($localFilePath . '/' . basename($value["file"]), $fileValue); - } - } - - // Set the session cookie with the current timestamp - setcookie('manifest_last_checked', time(), time() + 300); // Expire in 5 minutes -} - // Load the local manifest $localManifest = json_decode(file_get_contents($localManifestFile), true); @@ -83,6 +38,5 @@ if ($fileValue !== null) { $prefixedPath = '/plugins/dynamix.my.servers/connect-components/'; echo ''; } else { - echo ''; -} -?> + echo ''; +} \ No newline at end of file