|
|
@@ -26,7 +26,6 @@ $app->post('/test/ldap', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/ldap/login', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -49,7 +48,6 @@ $app->post('/test/ldap/login', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/iframe', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -72,7 +70,6 @@ $app->post('/test/iframe', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/path', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -92,7 +89,6 @@ $app->post('/test/path', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/plex', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -115,7 +111,6 @@ $app->post('/test/plex', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/emby', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -138,7 +133,6 @@ $app->post('/test/emby', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/jellyfin', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -161,7 +155,6 @@ $app->post('/test/jellyfin', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/sabnzbd', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -184,7 +177,6 @@ $app->post('/test/sabnzbd', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/pihole', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -207,7 +199,6 @@ $app->post('/test/pihole', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/rtorrent', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -230,7 +221,6 @@ $app->post('/test/rtorrent', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/sonarr', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -253,7 +243,6 @@ $app->post('/test/sonarr', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/radarr', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -276,7 +265,6 @@ $app->post('/test/radarr', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/lidarr', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -299,7 +287,6 @@ $app->post('/test/lidarr', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/sickrage', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -322,7 +309,6 @@ $app->post('/test/sickrage', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/ombi', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -345,7 +331,6 @@ $app->post('/test/ombi', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/overseerr', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -368,7 +353,6 @@ $app->post('/test/overseerr', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/nzbget', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -391,7 +375,6 @@ $app->post('/test/nzbget', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/utorrent', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -414,7 +397,6 @@ $app->post('/test/utorrent', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/deluge', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -437,7 +419,6 @@ $app->post('/test/deluge', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/jdownloader', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -460,7 +441,6 @@ $app->post('/test/jdownloader', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/transmission', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -483,7 +463,6 @@ $app->post('/test/transmission', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/qbittorrent', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -506,7 +485,6 @@ $app->post('/test/qbittorrent', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/unifi', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -529,7 +507,6 @@ $app->post('/test/unifi', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/unifi/site', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -552,7 +529,6 @@ $app->post('/test/unifi/site', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
-
|
|
|
});
|
|
|
$app->post('/test/tautulli', function ($request, $response, $args) {
|
|
|
/**
|
|
|
@@ -624,4 +600,26 @@ $app->get('/test/cron', function ($request, $response, $args) {
|
|
|
return $response
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
+});
|
|
|
+$app->post('/test/folder', function ($request, $response, $args) {
|
|
|
+ /**
|
|
|
+ * @OA\Post(
|
|
|
+ * security={{ "api_key":{} }},
|
|
|
+ * tags={"test connection"},
|
|
|
+ * path="/api/v2/test/folder",
|
|
|
+ * summary="Test folder path",
|
|
|
+ * @OA\Response(response="200",description="Success",@OA\JsonContent(ref="#/components/schemas/success-message")),
|
|
|
+ * @OA\Response(response="401",description="Unauthorized",@OA\JsonContent(ref="#/components/schemas/unauthorized-message")),
|
|
|
+ * @OA\Response(response="422",description="Error",@OA\JsonContent(ref="#/components/schemas/error-message")),
|
|
|
+ * @OA\Response(response="500",description="Error",@OA\JsonContent(ref="#/components/schemas/error-message")),
|
|
|
+ * )
|
|
|
+ */
|
|
|
+ $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
|
|
|
+ if ($Organizr->qualifyRequest(1, true)) {
|
|
|
+ $Organizr->testFolder($Organizr->apiData($request));
|
|
|
+ }
|
|
|
+ $response->getBody()->write(jsonE($GLOBALS['api']));
|
|
|
+ return $response
|
|
|
+ ->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
+ ->withStatus($GLOBALS['responseCode']);
|
|
|
});
|