Page 1 of 2

Complete Configuration API (rss, categories)

Posted: December 30th, 2010, 8:45 pm
by pmow
It would be nice to be able to add/remote/modify things like RSS and categories from the API.  I realize it's not a common request, but it would make automation possible.  (I've been working on a multi-user frontend which really cannot go any further.)

edit: and if it's in but not documented, apologies =)

Re: Complete Configuration API (rss, categories)

Posted: December 31st, 2010, 4:25 am
by shypike
It's all in the API: http://wiki.sabnzbd.org/api
The documentation is not great, you may need to check out the source too (api.py).

Re: Complete Configuration API (rss, categories)

Posted: December 31st, 2010, 10:44 am
by pmow
Would it be the "new" api_del_config and api_set_config functions added in 2009? 

I'd love to help with the documentation (I think I owe inpheaux a section on addfile for api) once I get all the keywords.

Re: Complete Configuration API (rss, categories)

Posted: January 1st, 2011, 7:47 am
by shypike
Register an account at WikiDot.com and I can add you to the editors.

Re: Complete Configuration API (rss, categories)

Posted: January 5th, 2011, 2:17 pm
by pmow
Thanks, my username is 'pmow'.  If the answer to my question is yes, and those functions can set/clear any configuration keywords including RSS and categories, is there a complete list anywhere of those keywords?  (I didn't hear back on it)

Re: Complete Configuration API (rss, categories)

Posted: January 5th, 2011, 3:37 pm
by shypike
HI,

I sent you the editor invitation.
With "the complete" list, I assume you mean the set of sections and keywords for configuration.
These are the sections and keywords that you see in the sabnzbd.ini file.
So when you see
[misc]
complete_dir = bla

The corresponding API call is
api?mode=set_config&section=misc&keyword=complete_dir&value=bla&apikey=secret

Re: Complete Configuration API (rss, categories)

Posted: January 5th, 2011, 3:44 pm
by pmow
These emoticons cannot properly express my level of affection for you right now.  <3

Re: Complete Configuration API (rss, categories)

Posted: January 5th, 2011, 6:06 pm
by pmow
I've looked up other threads that reference set_config, and I have two questions:
1. How would I go about creating a new entry?  (I have tried set_config to add a feed, and have gotten "doesn't exist".)  Tried a few other things too but no dice.
2. Part of the RSS entry consists of a rule ACL, which is returned by get_config as an array.  How would one go about setting that?

Re: Complete Configuration API (rss, categories)

Posted: January 6th, 2011, 3:44 am
by shypike
1. Not sure if it has been tested to that level. I'll check.
2. That would be a comma-separated list, with elements that contain spaces embedded in quotes.
Remember to do proper URL quoting too (Like replacing = with %3D).

Re: Complete Configuration API (rss, categories)

Posted: January 6th, 2011, 1:49 pm
by shypike
1.
This was an oversight in the implementation.
Adding entries is done properly for servers (which needed special treatment any way).
It wasn't handled for rss and categories.
I have added the required code to the 0.6.0 code base, but I won't add it to 0.5.x.

Re: Complete Configuration API (rss, categories)

Posted: January 6th, 2011, 2:15 pm
by pmow
shypike wrote: 1.
This was an oversight in the implementation.
Adding entries is done properly for servers (which needed special treatment any way).
It wasn't handled for rss and categories.
I have added the required code to the 0.6.0 code base, but I won't add it to 0.5.x.
Thanks.  If you commit to a version I can test with, I will add to the other changes I've started making in the wiki with version info.

Re: Complete Configuration API (rss, categories)

Posted: January 6th, 2011, 5:23 pm
by shypike
We'll soon do Beta1.
If not, I can pass you an extra build.

Re: Complete Configuration API (rss, categories)

Posted: January 12th, 2011, 12:52 pm
by pmow
shypike wrote: We'll soon do Beta1.
If not, I can pass you an extra build.
I noticed revision 2598 and your notes.  Since all this is optional, unlike many [misc] keywords, can you include delete support as well?  From the source I couldn't tell so I thought I'd post  :)

Re: Complete Configuration API (rss, categories)

Posted: January 12th, 2011, 1:06 pm
by shypike
Deleting is rather useless, the field will come back with the next start.
You're probably asking for a possibility to go back to default values.

Re: Complete Configuration API (rss, categories)

Posted: January 12th, 2011, 1:21 pm
by pmow
To be clear, I'm asking to delete an entire key; AKA, a server, a category, or a feed.  Just remove the entire thing, just like adding it.