Skip to content

Console: Listen in player opens the book in the web player, signed in - #144

Merged
KodeStar merged 4 commits into
mainfrom
feat/listen-in-player
Oct 16, 2026
Merged

KodeStar merged 4 commits into
mainfrom
feat/listen-in-player

Conversation

@KodeStar

Copy link
Copy Markdown
Owner

Closes #137.

The admin book page gains Listen in player (beside Match, only with the web_player capability). A click opens a tab synchronously (so no pop-up block), mints a one-time token with the existing POST /auth/pair, and points the tab at the same-origin /web/connect?token=&sid=&uid=&book=&path= (never the payload's web_url, which may be another origin). If the call fails the tab closes and a toast says why; one token per click.

No Go change. Pairs with KodeStar/audiosilo-frontend (feat/listen-in-player), which reads book/path/uid: already signed in as that user it opens the book without an exchange (after a GET /me check, so a revoked token falls through to the exchange), else it pairs and ends on the book. /web ships with the server, so the two land together.

Verification

  • Console tests: URL shape, opener cleared, one pair call however fast the clicks, tab closed on failure, hidden without the web player.
  • Real browser (headless Chromium, player built from the frontend branch): first click = pair + exchange, lands on the book signed in, playback runs; second click = pair + GET /me, no exchange; after revoking the device = GET /me 401 then exchange, lands signed in; a bogus link behaves as any failed pairing link.

Known: a skipped exchange leaves that click's single-use token unspent until it expires (10 minutes). Pairing tokens are never pruned from tokens (pre-existing); worth a small retention job later.

Docs: KodeStar/audiosilo-docs (docs/listen-in-player).

A narrow PairToken for the two fields the console reads of POST /auth/pair, playerConnectUrl takes the token, the user and the book, and the button ignores clicks while its token is on its way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin view/editing lacks any way to listen to the book in question

1 participant