Browse Source

Add JellyStat metadata API route to homepage routing

- Added POST /homepage/jellystat/metadata endpoint following the same pattern as other media server metadata routes
- This resolves the 404 error when clicking on JellyStat poster cards for metadata popups
- The route calls the getJellyStatMetadata() method that was previously added to the JellyStat plugin
mgomon 8 tháng trước cách đây
mục cha
commit
a5d556e02b
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      api/v2/routes/homepage.php

+ 8 - 0
api/v2/routes/homepage.php

@@ -629,3 +629,11 @@ $app->get('/homepage/jellystat', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 });
+$app->post('/homepage/jellystat/metadata', function ($request, $response, $args) {
+	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
+	$Organizr->getJellyStatMetadata($Organizr->apiData($request));
+	$response->getBody()->write(jsonE($GLOBALS['api']));
+	return $response
+		->withHeader('Content-Type', 'application/json;charset=UTF-8')
+		->withStatus($GLOBALS['responseCode']);
+});