feat: optional Plex activity (Tautulli) integration + latency-aware health chips#60
Open
ndandan wants to merge 1 commit into
Open
feat: optional Plex activity (Tautulli) integration + latency-aware health chips#60ndandan wants to merge 1 commit into
ndandan wants to merge 1 commit into
Conversation
…alth chips Adds a read-only Tautulli integration (configured in /admin/settings, behind the per-service health circuit breaker) that surfaces current Plex activity: - Dashboard "Current Plex activity" widget — active streams, Direct Play / Direct Stream / Transcode counts, total/LAN/WAN bandwidth, per-session cards (quality, HDR/SDR badge, source->target codec on transcode). Hydrates async and refreshes every 10s; fails open so a down Tautulli never breaks the page. - Dedicated Plex Activity page (own sidebar entry): now-playing strip, watch stats with a 7/30/90-day toggle, plays-over-time graphs (Media/Stream-type toggle, by-hour, by-day-of-week, platform x stream-type problem-clients), dense history grid, per-library counts, and an in-app info modal per title. - API key stays server-side; every response is sanitised before the browser. - Chart.js self-hosted for CSP compliance, reused by the Radarr stats chart. Also reworks the dashboard service-health chips to show latency: HealthService::statusFor() returns a status word + round-trip ms (cached 10s, isHealthy() now delegates to it and keeps its old contract). Chips render five states (up / slow / very_slow / down / degraded) with a coloured dot. Tests: TautulliClient (HTTP + normalizers + edge cases), TautulliController (endpoints + route guard), HealthService statusFor/classifyLatency, and the relative_date Twig filter.
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional, read-only Plex activity integration via the Tautulli API, plus a latency-aware rework of the dashboard service-health chips (the two ship together because both pivot on
HealthService).Plex activity (Tautulli)
Configured like any other service in
/admin/settings(URL + API key), gated byisConfigured(), and registered with the per-service health circuit breaker. Two surfaces:/tableau-de-bord/widget/plex) that hydrates on its own and refreshes every 10 s. Returns an empty body (hidden client-side) when Tautulli isn't configured.Security/robustness: the API key never leaves the server, every Tautulli response is normalised/sanitised before it reaches the browser, and each section/widget fails open independently so a down or misconfigured Tautulli never breaks the dashboard or the page. Chart.js is self-hosted under
public/static/chart/for CSP compliance (no CDN), and the existing Radarr stats chart is repointed at the self-hosted copy.Latency-aware health chips
HealthService::statusFor()returns['status' => up|slow|very_slow|down|degraded|null, 'latencyMs' => ?int], cached 10 s exactly like the old bool path — which now delegates to it, soisHealthy()keeps its existing contract for every current caller. The dashboard chips render the five states with a coloured dot, so a reachable-but-slow service is visibly distinct from a healthy one.Why
Plex/Tautulli is one of the most-requested homelab companions to the *arr stack, and the health chips going from "up/down" to "up/slow/degraded/down" makes a struggling-but-reachable service legible at a glance.
Definition of Done
TautulliClient(HTTP, normalizers, edge cases — nulls, empty, unicode, boundaries),TautulliController(endpoints + route guard),HealthService::statusFor()/classifyLatency()(incl. the 750/2000 ms boundaries and cache-hit), and the sharedrelative_dateTwig filter.make check(lint + Twig + full PHPUnit) green.healthInvalidatewhiteliststautulli.var,.then(), declarative modal triggers, polling timers cleaned up onturbo:before-render); dynamic values escaped viaescHtml; tested in dark + light + a mobile viewport.README.md(Plex activity section + Tautulli prereq) andCHANGELOG.md[Unreleased]updated.