Repository navigation
Conversation
Behind the alt-backend feature (off in every PlxNative build), the data, playback and live-update methods of plex::Client hand their call to an installed plex::backend::Backend and return its answer; without the feature the alt! hook expands to nothing and the code is what ships today. While a backend is installed, plex.tv is never contacted, the account's audio and subtitle preferences are read from and saved to the backend, a sign-in the backend vouches for may use a plaintext private-network origin, and the backend may name the app and its own credential spellings so the plaintext policy sees them. This change was drafted with an AI assistant (Claude Code). Signed-off-by: Tiago Pereira <1698241+tiper@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Before:
plx_plex::plex::Clientcan only talk to a Plex server, so an app that wants to reuse PlxNative's screens, player and stores against another kind of media server has to fork the data layer.After: behind a new
alt-backendcargo feature (off in every PlxNative build, so nothing here is compiled into PlxNative), an application can install aplex::backend::Backendat boot, and the data, playback and live-update methods ofClienthand their call to it and return its answer in the same model types. Without the feature, thealt!hook at the top of each method expands to nothing.How:
Backendis a trait whose every method defaults to "nothing here" (None,false, an empty path), so a Plex-only feature such as Discover or agent subtitle search simply disappears for a server without one. While a backend is installed:grant::PlaintextAsk::settle_vouchedlets the backend's own sign-in mint a plaintext grant, under the same origin rule asmint(a numeric private-network literal, current generations, no refusal since).serversqueues an endpoint re-proof (grant::strand) for a plaintext origin registered without a grant, since there is no plex.tv discovery to do it.identity::app_name, used by whatever shows a name to the viewer;PRODUCTstays what a Plex server is sent) and list its own credential spellings, sohttp::carries_credentialtreats them likeX-Plex-Token.has_plex_home,rows_resolve_by_key,fixed_hls_availableandversionsgive the app side the few answers that differ from Plex's.Nothing changes for PlxNative builds.