api attribute for jobs
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
api attribute for jobs
i am trying to write a script to shutdown sabnzbd if it isnt doing anything but i cant find much documentation on what the xml api attributes do. i figured out how to work with the queue but is there one for something like jobs? i can tell it to shutdown if the queue is empty but i would also need a way to interface with sabnzbd to see if it is doing any other processing such as extracting, repairing, running post-processing scripts, etc. is this possible?
Re: api attribute for jobs
It is a bit complicated, but you would need the "history" api call to determine the state of the post-processing queue.
Any history item that has a "loaded" attribute with value "true", is either waiting or being processed.
I'll see if I can add a simple status variable to the "qstatus" call.
But that won't help you until the next release.
Code: Select all
http://host:8080/sabnzbd/api?mode=history&start=0&limit=4&apikey=bla&output=json
I'll see if I can add a simple status variable to the "qstatus" call.
But that won't help you until the next release.
Re: api attribute for jobs
A solution will be in 0.7.4
The qstatus call will have a new variable "pp_active".
This combination will indicate idle mode:
The qstatus call will have a new variable "pp_active".
This combination will indicate idle mode:
Code: Select all
(state=="IDLE" or state=="PAUSED") and not pp_active
Re: api attribute for jobs
wow, that is awesome. thanks so much.
Re: api attribute for jobs
so, just to make sure i understand this correctly, anytime there is a "loaded" attribute in the history api with a value of "true", then it is busy doing something?
Re: api attribute for jobs
Yes, although there could be exceptional situations.
But generally, yes.
But generally, yes.