this post was submitted on 13 Jul 2023
14 points (93.8% liked)

Jellyfin: The Free Software Media System

5478 readers
49 users here now

Current stable release: 10.9.7

Community Standards

Website

Forum

GitHub

Documentation

Feature Requests

Matrix (General Information & Help)

Matrix (Announcements)

Matrix (General Development)

Matrix (Off-Topic) - Come get to know the team and blow off steam!

Matrix Space - List of all the available rooms on Matrix.

Discord - Bridged to our Matrix rooms

founded 4 years ago
MODERATORS
 

I'm looking at making a fun project for generating media recommendations based on past viewing behavior and I'd like to know if the API exposes something like "previous N items that user X played"

Looking through the swagger docs on my server, i see an endpoint of /Users/{UserID}/Views but that only seems to return all of my libraries, not the individual media for that given user's playback history. I'd like to get the last X (configurable) items that a given user Id has played, but no luck so far.

I'm using the python library here

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (2 children)

I browsed to my jellyfin media library with the network tab open and set the filter to "Played" and it made a request like this:

https://{ host }/Users/{ user_id }/Items?SortBy=DateCreated%2CSortName%2CProductionYear&SortOrder=Descending&IncludeItemTypes=Movie&Recursive=true&Fields=PrimaryImageAspectRatio%2CMediaSourceCount%2CBasicSyncInfo&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CBanner%2CThumb&StartIndex=0&Limit=100&Filters=IsPlayed

[–] [email protected] 1 points 1 year ago

I can't check right now, but if you go to your.ip:8096/api-docs/swagger/index.html you can see all endpoints.

Sorry for posting here, somehow I cant respond to the op.

[–] [email protected] 1 points 1 year ago

Thanks, that's a great start. Perhaps a combination of the limit, filters, and sort by query parameters might get me there. Now to find what all options there are other than date created for the sorting.

[–] [email protected] 1 points 1 year ago

The PlaybackReporting plugin supports that. You can get the item IDs of every media item each user played, along with the timestamp and duration. You can also filter the results using a SQP query. Let me know if you need additional pointers!

load more comments
view more: next ›