Jellyfin Forum
Schedule a pause for users or limit time to access/watch - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Schedule a pause for users or limit time to access/watch (/t-schedule-a-pause-for-users-or-limit-time-to-access-watch)



Schedule a pause for users or limit time to access/watch - kuligs2 - 2024-02-13

Hi, is there a way to schedule a pause for users on jellyfin server? What i mean if i watch a movie or series and fall asleep i would like it to stop at some point.

Like i would set to pause time for my user session or active movie or something at like 01:00am .

This way, at least when im watching on phone the phone screen turns off and saves battery Smiling-face


If anyone knows a way to achieve this, could you post how?


RE: Schedule a pause for users or limit time to access/watch - tmsrxzar - 2024-02-13

what you are wanting is a client side feature not a server one so you will have to investigate this for your unnamed client on your unnamed device

it would be called a "Still Watching?" feature


RE: Schedule a pause for users or limit time to access/watch - TheDreadPirate - 2024-02-13

This is not currently a thing in Jellyfin. What I, and some other people do, who fall asleep to re-runs is to set a sleep timer on the TV. But you need to ensure your TV has CEC enabled so that the TV tells Jellyfin to stop streaming.


RE: Schedule a pause for users or limit time to access/watch - kuligs2 - 2024-02-13

the problem is watching on phone Slightly-frowning-face. and why cant it be server side thing? i can log into dashboard and stop stream. why cant there be a scheduler or allowed times when users can be or allowed to watch stuff or something liek that? parental control or something..


RE: Schedule a pause for users or limit time to access/watch - tmsrxzar - 2024-02-13

(2024-02-13, 08:12 PM)kuligs2 Wrote: the problem is watching on phone Slightly-frowning-face. and why cant it be server side thing? i can log into dashboard and stop stream. why cant there be a scheduler or allowed times when users can be or allowed to watch stuff or something liek that? parental control or something..

this should be a client side thing, i can't imagine a server kicking people off because they fell asleep

but, that's just my opinion

if you feel strongly enough that it really needs to be a server feature then by all means fill out a feature request https://features.jellyfin.org


RE: Schedule a pause for users or limit time to access/watch - TheDreadPirate - 2024-02-13

There are also phone apps that have a similar function. Of course, you need to know you intend to fall asleep to enable it.

Netflix and other streaming services do it purely to conserve their bandwidth costs. With self hosting that is rarely a concern, especially with local clients.


RE: Schedule a pause for users or limit time to access/watch - kuligs2 - 2024-02-13

Well i guess ill have to write up a page that handles this.. good thing it can be done using API. It would be good if you could atleast point me to the docs but i found it myself. https://api.jellyfin.org/#tag/Session/operation/SendPlaystateCommand

Could write up a sort of tasker that would send commands to user at speciffic times, like a cron job or something.. it would be nice to have a plugin like that built in, but im too dumb to do it in C#


RE: Schedule a pause for users or limit time to access/watch - tmsrxzar - 2024-02-13

(2024-02-13, 09:21 PM)kuligs2 Wrote: It would be good if you could atleast point me to the docs but i found it myself.

99% of people coming to forums for answers are not developers
98% do not write code

so i do not offer options that cannot be done by a "normal" user (via interface or prebuilt options)
had you asked i could have linked it, pretty obvious it wasn't necessary for me to do so

given you mentioned doing a cronjob, why not just set a cronjob to restart the jellyfin server every morning at 1am
restarting the server should kick off all users


RE: Schedule a pause for users or limit time to access/watch - kuligs2 - 2024-02-13

Restarting server might work, but im not sure if it will pause the episode im currently on. so tha i can continue next day. and doing brutal shutoff is kinda.. well.. brutal.. Also i have user specific cases. Some users have schedule that they need to follow etc.

I think ill make simple table type thing webui for internal use, where it querries all the sessions, then you pick a session by username and device name, store those two in some DB - json file, then create new entry in table to set the time you want to pause this session, send warning message 30s before it pauses "steam will pause in 30s" and 1s after it pauses "stream has been paused". Rinse and repeat. Only thing im worried about querrying the session id every day, becasue when you GET /Sessions its 10k of lines of data that gets returned. And atm i have only sentient users.. but it returns some background apps sessions too wich i dont need atm. Not sure if session id changes with each day or server reboot or whatever.. or does it stay the same with user/device. Like phone app session id will stay the same but web browser session id will constantly change on every login. IDK..
Or maybe ill just make bash script that does the thing automagically, but then it will be a pain to edit and tweak if need be. Still not sure how to tackle this..

But it would be cool if you could set to stop playing per episodes. like you mark an episode in playlist to be the last for today and when it ends then the playlist is paused or shut down so that the phone can go into sleep mode.