Page 1 of 1

API delete failed only not working?

Posted: January 2nd, 2013, 4:29 pm
by diecast
I wanted to know, why does the following call delete everything:

Code: Select all

api?mode=history&name=delete&value=all&failed_only=1&del_files=1
I thought it would only delete failed items?

Re: API delete failed only not working?

Posted: January 2nd, 2013, 4:34 pm
by shypike
The correct API-call is:

Code: Select all

api?mode=history&name=delete&value=failed&del_files=1
Yes, it makes no sense :(

Re: API delete failed only not working?

Posted: January 2nd, 2013, 11:03 pm
by diecast
Thanks. I also have executed this API command and it does not remove the files - it only removes the item from history.

Code: Select all

action = "api?mode=history&name=delete&value=%s&del_files=1"
http://%s/sabnzbd/%s&ma_username=%s&ma_password=%s&apikey=%s" % (SAB_IP, action % id, SAB_USER, SAB_PASS, SAB_APIKEY)
Which is the same as calling it without "del_files=1"

Would someone be willing to test this on their local system?

Re: API delete failed only not working?

Posted: January 3rd, 2013, 12:05 pm
by shypike
It does work when I test it.
BTW: the ma_password and ma_username parameters are not needed when you already supply the apikey.

Re: API delete failed only not working?

Posted: January 3rd, 2013, 12:08 pm
by diecast
shypike wrote:It does work when I test it.
BTW: the ma_password and ma_username parameters are not needed when you already supply the apikey.
Thanks! I just logged onto IRC to try and hunt someone down. >:D

I'll remove the ma_pass/user and try again.

Re: API delete failed only not working?

Posted: January 3rd, 2013, 12:16 pm
by shypike
diecast wrote: I'll remove the ma_pass/user and try again.
It's not that those parameter prevent the correct working, they're just not needed.
I haven't been able to reproduce your problem.
You're sure the job-id is correct? The API call will return "ok" even for a non-existing job.