Complete Configuration API (rss, categories)

Want something added? Ask for it here.
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Complete Configuration API (rss, categories)

Post 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 =)
Last edited by pmow on December 30th, 2010, 8:52 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Complete Configuration API (rss, categories)

Post 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).
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

Post by shypike »

Register an account at WikiDot.com and I can add you to the editors.
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

Post 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
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

Post by pmow »

These emoticons cannot properly express my level of affection for you right now.  <3
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

Post 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.
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

Post by shypike »

We'll soon do Beta1.
If not, I can pass you an extra build.
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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

Re: Complete Configuration API (rss, categories)

Post 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.
pmow
Release Testers
Release Testers
Posts: 57
Joined: May 15th, 2009, 6:09 pm
Location: Florida

Re: Complete Configuration API (rss, categories)

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