• 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: 3
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #1
    2025-12-18, 11:31 PM (This post was last modified: 2025-12-18, 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: 307
    Threads: 5
    Joined: 2023 Jun
    Reputation: 18
    Country:Netherlands
    #2
    Yesterday, 06:37 AM
    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]
    Fingel
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #3
    4 hours ago
    (Yesterday, 06:37 AM)niels Wrote: 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.


    Hi, I'm still not clear on what this means. Is the reporting API something clients are responsible for calling? Like they need to increment by one somehow (atomically)? The api docs are pretty bare in this regard. There is https://api.jellyfin.org/#tag/Playstate/...ackStopped but it's marked as deprecated, but no indication if it's been replaced with anything.
    niels
    Offline

    Core Team

    Posts: 307
    Threads: 5
    Joined: 2023 Jun
    Reputation: 18
    Country:Netherlands
    #4
    4 hours ago
    Yes clients need to report start, progress (every few seconds) and stop messages for proper reporting in the dashboard among others. The ReportPlaybackProgress should be responsible for stuff like marking items as watched and incrementing the play count.
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    Fingel
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #5
    3 hours ago
    For anyone else finding this, I'm guessing this is the Playstate api: https://api.jellyfin.org/#tag/Playstate I will try to implement this and report back. Thank you!
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • 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