• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Help understanding the PlayCount UserData from API.

     
    • 0 Vote(s) - 0 Average

    Help understanding the PlayCount UserData from API.

    Trying to make sense of these numbers for client development.
    Fingel
    Offline

    Junior Member

    Posts: 1
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #1
    Yesterday, 11:31 PM (This post was last modified: Yesterday, 11:34 PM by Fingel. Edited 1 time in total.)
    Hello! 

    First off, I love Jellyfin. In fact I love it so much I decided to write my own client, Gelly.

    A feature I would like (and that has been requested) is to be able to view the play count for Items. So I took a look at the API and I was happy to see that it appears there is a field in the /Items/ endpoint response which looks like just the ticket:

    Code:
    {
      "Items": [{
        "Name": "string",
         ...,
         "UserData": {
           "PlayCount": 0,
           ...,
          }
      }]
    }

    However, when I actually printed out these values, the numbers seemed off in the low direction. There are songs in my library I know I have listen to (possibly 10s of times!) and yet I don't see a PlayCount greater than 2.

    How is this number calculated? One explanation that I can think of is that it's not actually updated automatically. I see there is a POST /UserItems/{itemId}/UserData endpoint. Does this mean clients are meant to explicitly update the playcount themselves? So in the case of badly behaving clients (such as my own) the counts could be totally off?

    The other thing I can think of is that it works on some rolling window, though that seems less likely.

    Any insight would be appreciated!
    niels
    Offline

    Core Team

    Posts: 306
    Threads: 5
    Joined: 2023 Jun
    Reputation: 18
    Country:Netherlands
    #2
    9 hours ago
    I would assume it is based in the reporting API, so increment by one when playback stop is reported and progress is near the duration of the item.
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    « Next Oldest | Next Newest »

    Users browsing this thread:


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode