When using the addfile function in combination with the name parameter (like below), the name is ignored when sending a zip file containing 1 .nzb file
http://host:port/sabnzbd/api?mode=addfile&name=<filename>&cat=<category>
I use this to send nzbs for CouchPotato. Now it works fine for most providers, but spotweb providers sometimes return a zip file (it's an option in spotweb to use .zip or .nzb). I assume SAB extracts the zip and uses the name of the .nzb file and then adds it to the queue. I understand this when uploading a zip with multiple files (manually). But automated processes include the name parameter for a reason
This zip file contains a single .nzb file. What I would like is to use the name parameter when it's a zip file. Just like it would when doing the same requests with .nzb file.
Tested on version: 0.7.7
Thanks!
API addfile: name parameter is ignored
Forum rules
Help us help you:
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.
-
- Sr. Member
- Posts: 305
- Joined: July 2nd, 2010, 6:11 am
Re: API addfile: name parameter is ignored
There are two names to choose from, so picking one is arbitrary.
SABnzbd always uses the internal names in ZIP files, because the format
is oriented towards multiple files.
The proper way to do the API call would be to use the extra parameter "nzbname".
This isn't supported currently, but I'm willing to change that.
Using the "name" parameter is not consitent with the way SABnzbd generally treats
ZIP files and it would change behaviour from previous releases.
SABnzbd always uses the internal names in ZIP files, because the format
is oriented towards multiple files.
The proper way to do the API call would be to use the extra parameter "nzbname".
This isn't supported currently, but I'm willing to change that.
Using the "name" parameter is not consitent with the way SABnzbd generally treats
ZIP files and it would change behaviour from previous releases.
-
- Sr. Member
- Posts: 305
- Joined: July 2nd, 2010, 6:11 am
Re: API addfile: name parameter is ignored
Something that would force the name (on single .nzb zipfile) would be great, thanks.
Now I have to tell my users they need to change the spotweb setting, which isn't ideal.
Or a way to get the name (or ID) it was added to the queue with, would also work. I can't use api?mode=queue&name=rename&value=SABnzbd_nzo_zt2syz&value2=THENEWNAME because I don't know the name. I could guess it, but when adding more stuff to the query at the same time, it could go wrong quite easily.
Now I have to tell my users they need to change the spotweb setting, which isn't ideal.
Or a way to get the name (or ID) it was added to the queue with, would also work. I can't use api?mode=queue&name=rename&value=SABnzbd_nzo_zt2syz&value2=THENEWNAME because I don't know the name. I could guess it, but when adding more stuff to the query at the same time, it could go wrong quite easily.
Re: API addfile: name parameter is ignored
I changed the code to support "nzbname", because that is more consistent anyway
while not changing behaviour.
I understand your predicament, but why are the internal and external names different in the first place?
while not changing behaviour.
I understand your predicament, but why are the internal and external names different in the first place?
-
- Sr. Member
- Posts: 305
- Joined: July 2nd, 2010, 6:11 am
Re: API addfile: name parameter is ignored
For couchpotato I add ".cp(tt1231232)" (imdb id) to the filename. So later it can be picked up more easily.
Re: API addfile: name parameter is ignored
If you have users, which app are you developing?RuudBurger wrote: Now I have to tell my users they need to change the spotweb setting, which isn't ideal.
And if you're developing an app, why not add the nzbname parameter?
-
- Sr. Member
- Posts: 305
- Joined: July 2nd, 2010, 6:11 am
Re: API addfile: name parameter is ignored
Like I said, CouchPotato
I just double checked, and I indeed use nzbname (not name, but the problem is the same).
I just double checked, and I indeed use nzbname (not name, but the problem is the same).
Re: API addfile: name parameter is ignored
Right, it wasn't clear to me that you're working on CP.
I thought you were developing something using CP and SABnzbd.
Like I said, I changed the code and release 0.7.8 will work fine with the nzbname parameter.
I thought you were developing something using CP and SABnzbd.
Like I said, I changed the code and release 0.7.8 will work fine with the nzbname parameter.
-
- Sr. Member
- Posts: 305
- Joined: July 2nd, 2010, 6:11 am
Re: API addfile: name parameter is ignored
Thanks, will test this again when the new version is released.