|
|
@@ -50,4 +50,18 @@ $app->post('/plex/register', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
+});
|
|
|
+$app->get('/plex/servers', function ($request, $response, $args) {
|
|
|
+
|
|
|
+ $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
|
|
|
+ if ($Organizr->checkRoute($request)) {
|
|
|
+ if ($Organizr->qualifyRequest(1, true)) {
|
|
|
+ $Organizr->getPlexServers();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $response->getBody()->write(jsonE($GLOBALS['api']));
|
|
|
+ return $response
|
|
|
+ ->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
+ ->withStatus($GLOBALS['responseCode']);
|
|
|
});
|