Some API things
Posted: June 18th, 2010, 11:08 am
As you might know, I'm working a bit around with addons, and I would like to know if these things are possible (maybe even now, but couldn't find them in the documentation)
- After a succesfull file upload, get some more details. Like the nzo_id (the string like "SABnzbd_nzo_ipet0h"). Right now, the output says "ok", or, if XML output is requested, True. This is useful for more changes after the file upload.
- Allow more options in the mode. For example, setting the priority or the queue position when you upload a file.
If it's not clear what I mean, this is what I am working on:
If a user downloads a nzb file, he can upload it with category and a new name to sabnzbd. But from time to time, sabnzbd is currently downloading stuff which I need later, but not right now. And I want a movie to be downloaded before everything else is finished. It would be great to have a checkbox called "Put on top of queue". Right now, it looks like I have to do the following:
- Send the file to sabnzbd using mode=addfile.
- Getting the history using mode=qstatus.
- Comparing the filename with the filename the user specified, and retrieving the nzo_id from the xml or json output. (I personally don't like this part. I don't like to compare user input with internal stuff. Usually it's pretty hard to have that fool proof).
- Changing the queue position with mode=switch.
I think it would be great to skip the third step with my first suggestion. The second would be even better, but I guess that would make the development harder, and the documentation a mess with all the available options.
Last but not least, I saw that the file upload documentation was removed and replaced with "Allows a file upload to be sent, will be explained in more depth shortly.". I would love to see it back, I guess this has been removed with the 0.5.0 release?
- After a succesfull file upload, get some more details. Like the nzo_id (the string like "SABnzbd_nzo_ipet0h"). Right now, the output says "ok", or, if XML output is requested, True. This is useful for more changes after the file upload.
- Allow more options in the mode. For example, setting the priority or the queue position when you upload a file.
If it's not clear what I mean, this is what I am working on:
If a user downloads a nzb file, he can upload it with category and a new name to sabnzbd. But from time to time, sabnzbd is currently downloading stuff which I need later, but not right now. And I want a movie to be downloaded before everything else is finished. It would be great to have a checkbox called "Put on top of queue". Right now, it looks like I have to do the following:
- Send the file to sabnzbd using mode=addfile.
- Getting the history using mode=qstatus.
- Comparing the filename with the filename the user specified, and retrieving the nzo_id from the xml or json output. (I personally don't like this part. I don't like to compare user input with internal stuff. Usually it's pretty hard to have that fool proof).
- Changing the queue position with mode=switch.
I think it would be great to skip the third step with my first suggestion. The second would be even better, but I guess that would make the development harder, and the documentation a mess with all the available options.
Last but not least, I saw that the file upload documentation was removed and replaced with "Allows a file upload to be sent, will be explained in more depth shortly.". I would love to see it back, I guess this has been removed with the 0.5.0 release?