• 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 Development Server Development Testing API Additions

     
    • 0 Vote(s) - 0 Average

    Testing API Additions

    Dzvon2
    Offline

    Junior Member

    Posts: 20
    Threads: 8
    Joined: 2024 Apr
    Reputation: 0
    #1
    2025-03-10, 01:50 AM
    Howdy. For reference, I have never really done BE work before, my experience has been almost exclusively FE work, so go easy on me when I ask this. I have been in the process of trying to add a "Are you still watching" screen per the feature requests and I am tracking when you meet the condition for this screen to display on the server. The base conditions I am working off of, is there should be 2 episodes of media with no input interaction, and then 2 minutes into the 3rd episode the screen would appear. From what I can tell, there is no reporting we do if an input is registered in general, just if an input is on a registered button (ie a click on a button), so I have needed to create another endpoint for any input at all, which would be consumed in the different clients when the screen is implemented. I believe I have created the endpoint and logic correctly and I tried using postman to test if the endpoint does what I expect, but I just get an ECONNREFUSED error, which tells me I have something not configured correctly, but idk what. Should I be able to access my POST endpoint at url http://localhost:8096/Sessions/Playing/Interacted just by having my server running and hitting that endpoint? If this isn't enough to go off of I can push my branch and share a link to my commit if that's easier too. Thanks.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2025-03-10, 12:46 PM
    IMO, it would probably be better to do this kind of check fully on the client rather than the server. As you've realized, there is no server side tracking of a user's "idleness". To even support this feature there would need to be some sort of client side support for the feature anyway and the client is perfectly placed to determine when the last user input was. Doing the idleness tracking fully on the client also avoids the need for API changes.

    But there should be a server side setting that enforces this on the clients if the intent is to avoid unnecessary usage. Making it an optional client side setting defeats the intent of this kind of feature.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Dzvon2
    Offline

    Junior Member

    Posts: 20
    Threads: 8
    Joined: 2024 Apr
    Reputation: 0
    #3
    2025-03-10, 02:19 PM (This post was last modified: 2025-03-10, 02:21 PM by Dzvon2. Edited 1 time in total.)
    (2025-03-10, 12:46 PM)TheDreadPirate Wrote: IMO, it would probably be better to do this kind of check fully on the client rather than the server.  As you've realized, there is no server side tracking of a user's "idleness".  To even support this feature there would need to be some sort of client side support for the feature anyway and the client is perfectly placed to determine when the last user input was.  Doing the idleness tracking fully on the client also avoids the need for API changes.

    But there should be a server side setting that enforces this on the clients if the intent is to avoid unnecessary usage.  Making it an optional client side setting defeats the intent of this kind of feature.

    You know it's really funny you say that because originally, I did this client side, put up a PR for the android tv repo and was told it would get rejected because I should be doing the logic check for idleness server side and the client consumed the server side changes. Each client still will need to have their own screen implementation so I wasn't really sure how much of a benefit doing just the logic check server side was going to do. And by server-side setting, do you mean whether this screen would appear or not?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2025-03-10, 02:59 PM
    (2025-03-10, 02:19 PM)Dzvon2 Wrote: You know it's really funny you say that because originally, I did this client side, put up a PR for the android tv repo and was told it would get rejected because I should be doing the logic check for idleness server side and the client consumed the server side changes.
     

    I'm not a dev, so if the dev said it would be better to do server side checks, so be it.

    (2025-03-10, 02:19 PM)Dzvon2 Wrote: And by server-side setting, do you mean whether this screen would appear or not?

    Yes.  If I was concerned about users running Jellyfin non-stop while they are sleeping or not around, having it be an optional client side setting defeats the intent of having this feature.  Having it be a server side config that all clients must implement is in line with the intent of this feature request.  If the server doesn't have this feature enabled, it could still be an optional client side config if you're the type of person that falls asleep to familiar content.

    For the more technical portions of your question, perhaps join the Jellyfin discord/matrix chat and post in the development chat?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « 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