Music Assistant image with Jellyfin playback reporting #1

Merged
james merged 1 commit from jellyfin-playback-reporting into main 2026-10-31 13:48:44 +00:00
Owner

Builds the official Music Assistant release with a patch that makes its Jellyfin provider report playback to Jellyfin. Upstream (2.10.9 stable and the current dev branch) never reports plays, so nothing played through MA reached Jellyfin play counts or Harmonie.

What the patch does

Implements the provider's on_played hook (the one the Plex and Emby providers already use). Each track becomes a Jellyfin playback session under MA's existing Jellyfin login (james): /Sessions/Playing on the first report, /Sessions/Playing/Progress every 30 s, /Sessions/Playing/Stopped with the real position at the end, skip or stop, and DELETE /UserPlayedItems/{id} when a track is marked unplayed. Jellyfin sets play count, last played and resume position itself, and Harmonie sees skips and listening time as well as completed plays. A failed report only logs a warning.

Build

Daily, on push to main and by hand: latest stable upstream release -> FROM ghcr.io/music-assistant/server:<version> -> patch --fuzz=0 (fails the build if it no longer applies) -> the test in tests/ runs inside the image against a fake Jellyfin server -> push forgejo.mcy.space/music-assistant/music-assistant:<major.minor>.<run>.

Tested locally (podman, 2.10.9)

  • Patch applies with fuzz 0; the patched file compiles.
  • Test PASS: played-through track (start, 2x progress, stop at 245 s), a track skipped at 10 s, mark-unplayed, a podcast episode ignored, a failing server logs a warning without raising; one PlaySessionId per track, the token in every request.
  • MA 2.10.9 starts normally on the patched image.

Before merging

REGISTRY_TOKEN must be added as this repo's Actions secret (a PAT with write:package, read:package, write:repository); without it the push step fails.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CbPPc19ztjvWzSc5JPMH2B

Builds the official Music Assistant release with a patch that makes its Jellyfin provider report playback to Jellyfin. Upstream (2.10.9 stable and the current dev branch) never reports plays, so nothing played through MA reached Jellyfin play counts or Harmonie. ## What the patch does Implements the provider's `on_played` hook (the one the Plex and Emby providers already use). Each track becomes a Jellyfin playback session under MA's existing Jellyfin login (james): `/Sessions/Playing` on the first report, `/Sessions/Playing/Progress` every 30 s, `/Sessions/Playing/Stopped` with the real position at the end, skip or stop, and `DELETE /UserPlayedItems/{id}` when a track is marked unplayed. Jellyfin sets play count, last played and resume position itself, and Harmonie sees skips and listening time as well as completed plays. A failed report only logs a warning. ## Build Daily, on push to main and by hand: latest stable upstream release -> `FROM ghcr.io/music-assistant/server:<version>` -> `patch --fuzz=0` (fails the build if it no longer applies) -> the test in `tests/` runs inside the image against a fake Jellyfin server -> push `forgejo.mcy.space/music-assistant/music-assistant:<major.minor>.<run>`. ## Tested locally (podman, 2.10.9) - Patch applies with fuzz 0; the patched file compiles. - Test PASS: played-through track (start, 2x progress, stop at 245 s), a track skipped at 10 s, mark-unplayed, a podcast episode ignored, a failing server logs a warning without raising; one PlaySessionId per track, the token in every request. - MA 2.10.9 starts normally on the patched image. ## Before merging `REGISTRY_TOKEN` must be added as this repo's Actions secret (a PAT with write:package, read:package, write:repository); without it the push step fails. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CbPPc19ztjvWzSc5JPMH2B
Builds the official Music Assistant release with patches/ applied. The
Jellyfin provider patch implements on_played, so each track played in
Music Assistant is reported to Jellyfin as a playback session (start,
progress, stop with position) and counts in Jellyfin and Harmonie.

A daily workflow builds each new stable upstream release, fails if the
patch no longer applies exactly, runs the test against a fake Jellyfin
server inside the image, and publishes <major.minor>.<run>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CbPPc19ztjvWzSc5JPMH2B
james merged commit 4099051ff5 into main 2026-10-31 13:48:44 +00:00
james deleted branch jellyfin-playback-reporting 2026-10-31 13:48:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
music-assistant/docker-music-assistant!1
No description provided.