Skip to main content

Jellyfin compatibility adapter (music only)

Imported component documentation. Source: melodee-project/melodee-api at commit 0267c458207082337d9baf1130deeb65f43c9d4a. Version 1.0.1. License MIT. Status: implemented-and-automatically-verified candidate; not published, deployed or production-qualified. This is the component's committed documentation, not proof of a distribution release or production qualification.

melodee-api exposes a deliberately music-oriented Jellyfin surface over the shared canonical Artist/Release/Track services. It is not a general-purpose video server: video, transcoding, live TV, sync and plugin endpoints are not implemented and are not advertised.

Authentication​

Create a revocable per-device credential with an interactive native session:

POST /api/v1/auth/compatibility-credentials
{ "protocol": "jellyfin", "label": "Living-room client" }

The one-time 64-hex secret is the Jellyfin access token (PostgreSQL stores only its SHA-256 digest). Present it as:

  • X-Emby-Token: <secret>, or
  • Authorization: Bearer <secret>, or
  • api_key=<secret> in the query.

POST /Users/AuthenticateByName accepts Username = the account UUID without hyphens and Pw = the credential secret, returning the same token. An interactive Melodee session bearer is not a protocol credential and is rejected. Revocation is immediate and disabled accounts are blocked.

Supported endpoints​

AreaEndpoints
SystemGET /System/Info/Public
AuthenticationPOST /Users/AuthenticateByName, GET /Users/Me, GET /Users/{id}
LibraryGET /Users/{id}/Views (one music library), GET /Items, GET /Items/{id}
ArtworkGET /Items/{id}/Images/Primary (302 to the public artwork variant)
PlaybackGET /Audio/{id}/stream, GET /Audio/{id}/universal (HTTP Range, 206, ETag)
FavoritesPOST/DELETE /Users/{id}/FavoriteItems/{itemId}
Ratings`POST /Users/{id}/Items/{itemId}/Rating?likes=true
Playback reportingPOST /Sessions/Playing, POST /Sessions/Playing/Stopped (Stop records a canonical Jellyfin listening event under central qualification)
PlaylistsGET /Playlists, GET /Playlists/{id}, POST /Playlists, DELETE /Playlists/{id}, POST /Playlists/{id}/Items?ids=

GET /Items supports parentId (library, artist, album), includeItemTypes (MusicAlbum, MusicArtist, Audio), searchTerm, limit (≤500) and startIndex. Items are MusicAlbum, MusicArtist, Audio and Playlist BaseItemDto-shaped objects with UserData (favorite, qualified play count, rating), RunTimeTicks (100 ns), image tags and album/artist links.

Canonical UUIDs are exposed as 32 lowercase hex characters (no hyphens), as Jellyfin clients expect. The music library id is stable. Pagination is bounded and no endpoint scans the whole catalog without a limit.

Deliberately unsupported​

Video, transcoding/remuxing, HLS, subtitles, live TV, DVR, plugins, scheduled tasks, user administration, Quick Connect, WebSocket session notifications, downloads/sync, play queues and resume-position persistence. Requests return 404 unless a supported route handles them; nothing unsupported is reported as working.

Named clients (Finamp, Fintunes, Jellyfin Media Player music mode, …) have not been tested. Verification is deterministic in-process HTTP fixtures only.

Cross-protocol guarantees​

  • Favorites, likes and playback events are the same canonical facts as the native API; they are visible at GET /api/v1/tracks/{id}/listener-state and in history.
  • Streaming serves the same immutable preferred asset with a strong SHA-256 ETag.
  • Playlist entries preserve occurrence identity; the same Track may be added twice.
  • A stream request never counts as a play; only a stopped session with a reported position creates a listening event, which the central policy qualifies.

Verification​

tests/api_v1.rs::jellyfin_music_surface_uses_canonical_items_and_revocable_credentials covers public server info, login/wrong password, token-header auth, rejection of an interactive session bearer, views, album/artist/song listing, search, item detail, missing artwork, ranged streaming, favorites and likes with native cross-checks, stopped-session playback storage, playlist create/add/detail/delete and cross- protocol token consistency.