Jump to content

The API returns the incorect UserData


Thuzad
Go to solution Solved by Luke,

Recommended Posts

Thuzad

Hello,

I was playing with the MUMC tool (https://github.com/terrelsa13/MUMC) and realized that the Emby API is not returning the correct UserData.

Emby version: 4.8.0.39 beta

https://streaming.domain/emby/Users/4fd64ef2422e40e0ba6e095eb9f74ecd/Items?ParentID=db4c1708cbb5dd1676284a40f2950aba&IncludeItemTypes=Movie&StartIndex=151&Limit=25&IsPlayed=True&Fields=Id,ParentId,Path,Tags,MediaSources,DateCreated,Genres,Studios&Recursive=True&SortBy=ParentIndexNumber,IndexNumber,Name&SortOrder=Ascending&EnableImages=False&CollapseBoxSetItems=False&EnableUserData=True&api_key=XXXXX
{
    Name: "Fast & Furious X",
...
    UserData: {
        PlaybackPositionTicks: 0,
        PlayCount: 0,
        IsFavorite: true,
        Played: true
    },
...
},

 

Whereas when I look in my developer console and retrieve the JSON by going to a movie, this is what I get:

https://streaming.domain/emby/Users/4fd64ef2422e40e0ba6e095eb9f74ecd/Items/1229467?Fields=ShareLevel&X-Emby-Client=Emby%20Web&X-Emby-Device-Name=Chromium%20Linux&X-Emby-Device-Id=ada2d6bb-a1d7-49e4-83a5-d38cb737451e&X-Emby-Client-Version=4.8.0.39&X-Emby-Token=XXXXXX&X-Emby-Language=fr
{
    Name: "Fast & Furious X",
...
    UserData: {
        PlaybackPositionTicks: 0,
        PlayCount: 1,
        IsFavorite: true,
        LastPlayedDate: "2023-07-18T20:51:25.0000000Z",
        Played: true
    },
...
}
Edited by Thuzad
Link to comment
Share on other sites

  • Solution

Try adding UserDataPlayCount and UserDataLastPlayedDate to your requested fields.

  • Thanks 1
Link to comment
Share on other sites

Thuzad

This does indeed correct the problem, but are there any other settings that have this problem?

Is this problem going to be solved or is this a normal for you?

Edited by Thuzad
Link to comment
Share on other sites

1 hour ago, Thuzad said:

This does indeed correct the problem, but are there any other settings that have this problem?

Is this problem going to be solved or is this a normal for you?

That is the fix. There's no problem to solve. The data is correct in the database, but you have to request the field in order for it to come out of the api.

I'll update the object so that it does not include the 0 value.

Link to comment
Share on other sites

Thuzad

I think it would be better not to display 0, or even the parameter in this case. Thanks for your feedback.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...