API delete failed only not working?

Get help with all aspects of SABnzbd
Forum rules
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.
Post Reply
diecast
Newbie
Newbie
Posts: 5
Joined: January 1st, 2013, 12:49 pm

API delete failed only not working?

Post 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?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API delete failed only not working?

Post 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 :(
diecast
Newbie
Newbie
Posts: 5
Joined: January 1st, 2013, 12:49 pm

Re: API delete failed only not working?

Post 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?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API delete failed only not working?

Post 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.
diecast
Newbie
Newbie
Posts: 5
Joined: January 1st, 2013, 12:49 pm

Re: API delete failed only not working?

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API delete failed only not working?

Post 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.
Post Reply