Browse Source

Add missing JellyStat API route to complete homepage integration

- Added /homepage/jellystat route in homepage.php that calls getJellyStatData()
- Completes the JellyStat homepage integration by providing the API endpoint
  required by the frontend JavaScript for data fetching
- Route follows same pattern as other homepage items like userWatchStats
- JellyStat plugin can now properly display analytics data on homepage
mgomon 8 tháng trước cách đây
mục cha
commit
e1aa11df5c
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/userWatchStats', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 });
+$app->get('/homepage/jellystat', function ($request, $response, $args) {
+	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
+	$Organizr->getJellyStatData();
+	$response->getBody()->write(jsonE($GLOBALS['api']));
+	return $response
+		->withHeader('Content-Type', 'application/json;charset=UTF-8')
+		->withStatus($GLOBALS['responseCode']);
+});