feat(jellyseer): sortable/filterable requests table on the Requests tab

Replace the static "recent requests" list with a proper table of all Jellyseerr
requests, sorted by date added (newest first by default) with standard sorting
and filtering.

Backend:
- JellyseerrClient.requests(max_count=500): paginated GET /api/v1/request
  (sort=added), mapped with type (movie/tv), status, media_status, and
  created_at labels. Returns up to 500 so the table can sort/filter client-side.
- fetch_jellyseer_requests(service) reuses the per-service cached client
  (shared with the stats widgets).
- new GET /api/jellyseerr/requests endpoint.

Frontend:
- JellyseerRequestsTable: TanStack Table (sorting via getSortedRowModel,
  pagination via getPaginationRowModel) reusing the Table primitives +
  TablePagination. Columns: Name / Type / Status / Media / Requested, all
  sortable; default sort Requested desc. A search box filters by name and a
  status dropdown defaults to "Open" (pending+approved+processing) with
  All/Pending/Approved/Declined options. (The shared DataTable is deliberately
  visibility-only, so this is a dedicated sortable table.)
- RequestsTab renders the stats grid + the new table (the compact recent list
  stays on the Requests overview widget).
- useJellyseerRequests hook + fetchJellyseerRequests API client.

Tests: client requests() mapping + single-page stop; fetch helper not-configured;
RequestsTab test mocks both hooks. 404/404 backend + 184/184 frontend pass;
build (tsc -b && vite build) + ESLint clean.
This commit is contained in:
Developer
2026-07-12 17:18:21 +00:00
parent 54851779fb
commit 7665ef4d10
21 changed files with 447 additions and 77 deletions
@@ -2,7 +2,7 @@
dir: backend/src/media_library_viewer_api/widgets
## role
Provides data fetching, normalization, and configuration logic for dashboard widgets across various integrated services and data sources.
Provides widget data adapters, built-in widget definitions, and stats-provider abstractions for fetching and normalizing dashboard data from various external services.
## parent
index: backend/src/media_library_viewer_api/.pi-map.index.md
map: backend/src/media_library_viewer_api/.pi-map.md
File diff suppressed because one or more lines are too long
@@ -62,9 +62,7 @@ class JellyseerrStatsProvider:
base_url = str(service.config.get("jellyseerr_url") or "")
# jellyseerr_api_key is migrating config -> secret; accept either during the transition.
api_key = str(
(service.secrets or {}).get("jellyseerr_api_key")
or service.config.get("jellyseerr_api_key")
or ""
(service.secrets or {}).get("jellyseerr_api_key") or service.config.get("jellyseerr_api_key") or ""
)
if not base_url or not api_key:
return StatsResult(
@@ -91,10 +89,7 @@ class JellyseerrStatsProvider:
return StatsResult(stats=[], detail=f"Jellyseerr fetch failed: {exc}")
result = StatsResult(
stats=[
StatValue(key=key, label=label, value=int(counts.get(key, 0)))
for key, label in _JELLYSEERR_STATS
],
stats=[StatValue(key=key, label=label, value=int(counts.get(key, 0))) for key, label in _JELLYSEERR_STATS],
recent=recent,
)
with self._lock:
@@ -103,3 +98,19 @@ class JellyseerrStatsProvider:
register_stats_provider("jellyfin", JellyseerrStatsProvider())
def fetch_jellyseer_requests(service: Any) -> list[dict[str, Any]]:
"""Return Jellyseerr requests for the Requests tab table.
Reuses the per-service cached client (shared with the stats widgets) so the
tab and widgets don't each open a new session.
"""
base_url = str(service.config.get("jellyseerr_url") or "")
api_key = str(
(service.secrets or {}).get("jellyseerr_api_key") or service.config.get("jellyseerr_api_key") or ""
)
if not base_url or not api_key:
return []
client = _jellyseer_client((service.id, base_url, api_key))
return client.requests(500)