Skip to content

feat(jellycompat): websocket server-push for remote control (Playstate/GeneralCommand) #122

Open

Description

@Quick104

Current state

The jellycompat websocket endpoint (GET /socket, internal/jellycompat/handlers_websocket.go) accepts upgrades and answers KeepAlive, but never pushes server-initiated messages. All other inbound message types are logged and ignored.

What clients expect

jellyfin-sdk-kotlin clients (e.g. Wholphin) hold the socket open and subscribe to:

  • PlaystateMessage — remote playback control: Pause, Unpause, Stop, Seek, NextTrack/PreviousTrack (Wholphin: PlaybackViewModel.kt, MusicService.kt)
  • GeneralCommandMessage — display messages and misc commands (Wholphin: ServerEventListener.kt)

Clients also advertise what they support via POST /Sessions/Capabilities (already implemented), so the server knows which commands each session accepts.

Why

Server-initiated pause/stop of client playback is the headline use case:

  • Admin terminates or pauses a session from the Silo UI (e.g. bandwidth pressure, household management)
  • Kicking a stale/stuck session so the client UI reacts instead of playing on
  • Future: parental controls / viewing-time limits, "play on device" casting

Rough scope

  1. Registry mapping authenticated socket connections to playback sessions (jellycompat sessions already exist; the realtime session hub on the native side may be reusable)
  2. Outbound message frames for Playstate and GeneralCommand per the Jellyfin websocket protocol
  3. A way to trigger commands — native admin API and/or Jellyfin-shaped POST /Sessions/{sessionId}/Playing/{command} + POST /Sessions/{sessionId}/Command
  4. Honor the per-session capabilities reported via /Sessions/Capabilities

References

  • Coverage audit: docs/architecture/wholphin-endpoint-coverage.md (websocket listed as the main partial implementation)
  • Stub: internal/jellycompat/handlers_websocket.go

🤖 Generated with Claude Code

Activity

  1. added
    v1.0
    on Jun 12, 2026
  2. added this to the v1 milestone on Jun 12, 2026
  3. added
    v1.0-proposed
    v1.0
    and removed
    v1.0
    v1.0-proposed
    on Jun 13, 2026
  4. removed this from the v1 milestone on Sep 19, 2026
  5. added
    needs-review
    and removed on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-reviewv1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions