Jump to content

How to check if the server is playing, recording etc


PenkethBoy

Recommended Posts

PenkethBoy

Having looked through swagger and the wiki i am coming up empty on the following things

 

1. How to query the server to see if it is currently playing/streaming 

2. If the server is scanning 

3. if its transcoding/converting media

 

So in simple terms is it idle - before i tell it to do x,y and z  - so it does not affect users/other processes etc

  • Like 1
Link to comment
Share on other sites

I would look through the api wiki because those three things each have separate apis. There is no single indication of idle.

Link to comment
Share on other sites

PenkethBoy

as i said i have looked through the (Api) Wiki and the documentation is fine for some things but not for finding the 3 things i want

 

if i have missed it fine - please give me things to look for

Link to comment
Share on other sites

For #1 I would look at the remote control section. #2 scheduled tasks. #3 sync but that section isn't completed yet.

  • Like 1
Link to comment
Share on other sites

PenkethBoy

ok thanks will have another look and report back

Link to comment
Share on other sites

  • 2 weeks later...
PenkethBoy

Ok for anybody who is wondering how to do this

 

1. To see if something is playing - check /emby/sessions and it will return info on all devices emby knows about and if a device is playing something it will have a "NowPlayingItem" array of info on the current playing item

2. To see if a scheduled tasks is running - check emby/ScheduledTasks and it will return info on each scheduled task defined in Emby (including hidden tasks) - each task has a "State" property which can be checked to see if the task is running

3. As above as the transcoding of say recordings is a scheduled task

4. To see if a LiveTV recording is in progress - check /emby/LiveTV/Recordings and it will return info with a "TotalRecordCount" of 0 if nothing is being recorded

 

I think that covers all bases - but if i have missed something i will report back or others can chip in.

 

The WIKI needs a lot of work as its out of date (i.e. things have changed a lot so some of the info is misleading/missing/wrong), does not provide actual examples and ONLY talks in general terms - which for people trying to get to grips with the API is far from useful.

Edited by PenkethBoy
  • Like 3
Link to comment
Share on other sites

PenkethBoy

An update

 

for liveTv Recordings

 

You are better off with

 

/emby/LiveTv/Recordings?UserId=<Id>&IsInProgress=true
 
if you leave off Inprogress=true you will get info on Inprogress plus completed recordings still in your Emby Recordings folders
Link to comment
Share on other sites

AmigaZoid

@PenkethBoy, Thank you for the info.  When I try the sessions command, I get "Unable to find the specified file."  The other commands like authentication and searching the library are working.  I'm using ..

 

 

  ip:port/sessions&api_key=<token>

also tried /emby/sessions

 

My last hurdle is trying to actually play some media. I wrote a home automation server in Nodejs that controls lights, TV, and with kodi json I wrote an alexa app that controlled all of these things as well as playing any media and directing it to any client. I'm trying to do the same with Emby, just need this last command to work. Thanks again for the info you provided.

Edited by AmigaZoid
Link to comment
Share on other sites

AmigaZoid

These replies must be automated.  I would bet to say that just about all of us that are posting questions have already conducted a search through these forums, checked all the wiki links and have come here as a last resort.  I saw that page and tried out /emby/sessions and /sessions already, thats why I'm now on the forum.  as PenkethBoy stated, the wiki is too general and is lacking is actual examples.

Edited by AmigaZoid
  • Like 1
Link to comment
Share on other sites

PenkethBoy

  ip:port/sessions&api_key=<token>

 

change the & to a ? - as we discussed in the other thread! :)

 

and its ip:port/emby/sessions?api_key

 

the unable to find the specified file - error - is telling you you are trying to use a non existent endpoint - clue for you to check your code

  • Like 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...