Page 1 of 1

Check Queue Empty?

Posted: August 28th, 2018, 4:08 am
by methanoid
I did actually look at the Wiki and see I can check the queue with this

http://IP:PORT/sabnzbd/api?output=json&apikey=MYAPIKEY&mode=queue

But what if I want to check to see whether the queue is empty or not? Basically I want to update parity on a low powered server IF/WHEN Sab has finished download and process of files....

Re: Check Queue Empty?

Posted: August 28th, 2018, 4:27 am
by safihre
You can look at noofslots_total, if it is 0 than there's nothing in the queue.

Re: Check Queue Empty?

Posted: September 15th, 2022, 3:24 am
by horstepipe
hello
I need to come back to this, I also regularly want to check whether my queue is empty.
I see the noofslots_total value, but how can I access it? Parsing the api respond with jq gives an error "parse error: Invalid numeric literal at line 1, column 11".
Could anybody advise me another way to extract the value from the response?

Re: Check Queue Empty?

Posted: September 15th, 2022, 4:07 am
by safihre
Did you make sure to include mode=json in the url? Otherwise it will not output json to parse.

Re: Check Queue Empty?

Posted: September 15th, 2022, 5:14 am
by sander
Works for me:

Code: Select all

sander@brixit:~$ curl -s 'http://192.168.1.4:8080/api?apikey=f7c0d38b95f2blablaa2607f5ba7673&output=json&mode=queue' | python3 -m json.tool | grep noof
        "noofslots_total": 0,
        "noofslots": 0,
HTH