Skip to content

feat: Yamtrack scrobbling via general-purpose tracking addon system - #204

Closed
sean-wils wants to merge 1 commit into
lostb1t:mainfrom
sean-wils:feat/yamtrack-tracking
Closed

feat: Yamtrack scrobbling via general-purpose tracking addon system#204
sean-wils wants to merge 1 commit into
lostb1t:mainfrom
sean-wils:feat/yamtrack-tracking

Conversation

@sean-wils

@sean-wils sean-wils commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

POC for foundational tracking addon with an initial implementation with Yamtrack

Adds a plugin-style tracking/scrobbling infrastructure so any future tracker
(Trakt, Simkl, Scrob) hooks in identically, with Yamtrack as the first
implementation.

Infrastructure:
- Internal tokio::broadcast event bus (TrackingEvent) on AppContext
- TrackingAddon trait with on_event() + optional event_filter()
- Per-user addon config stored in addon_users.config (new column)
- ProgressThrottle: suppresses progress events more frequent than 60s/session

Events emitted:
- PlaybackStart / PlaybackProgress / PlaybackStop (session.rs)
- MarkPlayed / MarkUnplayed / Favorite / UserRating (users.rs)

User ratings:
- New `rating REAL` column on user_media_state
- Jellyfin-compatible POST/DELETE /users/{id}/items/{id}/userrating
- Populated in UserItemDataDto

Yamtrack addon:
- Listens for PlaybackStop, MarkPlayed, MarkUnplayed
- Builds Jellyfin webhook plugin JSON payload
- Episodes resolved to series-level external IDs via get_ancestors()
- POSTs to {base_url}/webhook/jellyfin/{token}
- Global option: base_url; per-user option: token (Password)

SDK / Dashboard:
- user_options field on AddonMetadata and AddonDto (per-user credentials)
- GetUserAddonConfig / SetUserAddonConfig endpoint types
- Integrations section on user edit form: loads and saves per-user configs
  for addons with user_options (e.g. Yamtrack webhook token)
@OlegA-X

OlegA-X commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

It’s great that you’ve taken on the implementation. I was also thinking about scrobbling integrations, but I was wondering how to implement it so that users could manage their own integrations. I was thinking about a /profile (or /my) section - similar to the /admin section, but for a logged-in user. There, they could manage: their integrations (Yamtrack token, and in the future - Trakt, Simkl, Last.fm, etc.), and in the future, it could be expanded to include other personal settings.

What do you think about this? Doesn’t it go beyond the scope of the project’s idea and make things too complicated?@lostb1t

@lostb1t

lostb1t commented Aug 9, 2026

Copy link
Copy Markdown
Owner

While im not against the idea, it would be wise to discuss this first on discord to get the scope right

@sean-wils

Copy link
Copy Markdown
Contributor Author

Sounds wise. Good ideas @OlegA-X.
I'll drop a message in Discord.

@sean-wils

Copy link
Copy Markdown
Contributor Author

Closing this. Will cherry pick what I need when it comes to it.

@sean-wils sean-wils closed this Aug 13, 2026
@sean-wils
sean-wils deleted the feat/yamtrack-tracking branch August 13, 2026 09:36
@sean-wils

Copy link
Copy Markdown
Contributor Author

Superseded by #304.

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.

3 participants