feat: Yamtrack scrobbling via general-purpose tracking addon system - #204
feat: Yamtrack scrobbling via general-purpose tracking addon system#204sean-wils wants to merge 1 commit into
Conversation
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)
|
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 |
|
While im not against the idea, it would be wise to discuss this first on discord to get the scope right |
|
Sounds wise. Good ideas @OlegA-X. |
|
Closing this. Will cherry pick what I need when it comes to it. |
|
Superseded by #304. |
POC for foundational tracking addon with an initial implementation with Yamtrack