API question, change order of contents in a queue item?

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

Re: API question, change order of contents in a queue item?

Post by shypike »

sander wrote: so SAB should inform the user about the rar-status. So: if the rar is not perfect (or the download too slow), notice the viewer (=user) about that.
Like how? The user is watching TV, not SABnzbd's UI.
He/she will notice anyway, I guess :)
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: API question, change order of contents in a queue item?

Post by sander »

I had a look at the log, and the download/decoding order looks quite good to me:

Code: Select all

2011-03-26 08:37:54,590::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.vol00+01.par2 yenc
2011-03-26 08:40:54,455::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.rar yenc
2011-03-26 08:41:05,356::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r00 yenc
2011-03-26 08:41:14,997::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r01 yenc
2011-03-26 08:41:30,777::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r02 yenc
2011-03-26 08:41:48,092::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r03 yenc
2011-03-26 08:41:56,627::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r04 yenc
2011-03-26 08:42:22,845::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r05 yenc
2011-03-26 08:42:35,250::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r06 yenc
2011-03-26 08:42:43,547::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r07 yenc
2011-03-26 08:42:57,266::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r08 yenc
2011-03-26 08:43:05,620::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r09 yenc
2011-03-26 08:43:15,741::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r10 yenc
2011-03-26 08:43:26,623::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r11 yenc
2011-03-26 08:43:36,703::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.nfo yenc
2011-03-26 08:43:37,074::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r12 yenc
2011-03-26 08:43:51,431::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r13 yenc
2011-03-26 08:43:58,700::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r14 yenc
2011-03-26 08:43:59,222::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.par2 yenc
2011-03-26 08:43:59,234::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.sfv yenc
2011-03-26 08:44:00,804::INFO::[assembler:83] Decoding /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r15 yenc

The stream_unrar starts well, but stops after file 5, probably because SAB has already completed the download, and move the stuff away from 'incomplete'.



Code: Select all

sander@lifebook:~/stream_unrar$ ./stream_unrar -m /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03 -e stream-output
Beginning to monitor watch directories
Extracting /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.rar to stream-output

Waiting for /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r02
/home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r02 found
Waiting for /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r03
/home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r03 found
Waiting for /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r04
/home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r04 found
Waiting for /home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r05
/home/sander/Downloads/incomplete/Oh.Oh.Blabla.S01E03/oob.103-diff.r05 found
sander@lifebook:~/stream_unrar$ 
Last edited by sander on March 26th, 2011, 3:08 am, edited 1 time in total.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: API question, change order of contents in a queue item?

Post by sander »

shypike wrote:
sander wrote: so SAB should inform the user about the rar-status. So: if the rar is not perfect (or the download too slow), notice the viewer (=user) about that.
Like how? The user is watching TV, not SABnzbd's UI.
He/she will notice anyway, I guess :)
I mean: in the Status page of SAB. So that if/when things go wrong on TV, the user can see on SAB why. Otherwise there will be a lot of questions in the forum.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: API question, change order of contents in a queue item?

Post by sander »

@shypike (and @usenet ?):

Is there a soluton for the problem that the incomplete directory is gone before stream_unrar is finished? I tried pointing Incomplete and Complete to the same directory, but that results in a new directory .1 being created, problably because already exists.


 
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API question, change order of contents in a queue item?

Post by shypike »

Streaming isn't supported currently.
There is only an undocumented setting "allow_streaming"
that will prevent each finished job from being post-processed.
Instead it will be flagged as "failed" in the History waiting
for deletion or a PP retry.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: API question, change order of contents in a queue item?

Post by sander »

shypike wrote: Streaming isn't supported currently.
There is only an undocumented setting "allow_streaming"
that will prevent each finished job from being post-processed.
Instead it will be flagged as "failed" in the History waiting
for deletion or a PP retry.
... and it will stay in the incomplete directory?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API question, change order of contents in a queue item?

Post by shypike »

yes
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Re: API question, change order of contents in a queue item?

Post by Usenet »

shypike wrote: SABnzbd is already trying to sort it in a streaming-friendly order.
Ignore the fact that the par2 files are at the front.
As soon as the first (and smallest) vol.par file is in, the rest goes to the back of the queue.
Got some news here. Apparently if you set the job to +download, nothing in the file order is changed. But if you set it to +delete, the function is as you describe it.

Back to the queue sorting, is there any way you could use the tapi? Since there is functions in the plush skin to push a individual SABnzbd_nzf_xxxxx to the top. Just couldn't figure out the syntax...
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API question, change order of contents in a queue item?

Post by shypike »

Usenet wrote: Got some news here. Apparently if you set the job to +download, nothing in the file order is changed. But if you set it to +delete, the function is as you describe it.
Implicating that the sorting doesn't happen in "streaming mode"?
I'd say that the sorting should be done always. I'll check this.
Usenet wrote: Back to the queue sorting, is there any way you could use the tapi? Since there is functions in the plush skin to push a individual SABnzbd_nzf_xxxxx to the top. Just couldn't figure out the syntax...
The API's docs aren't great and the template-only party is worse.
If the sorting works properly, there isn't a real need to fiddle with the API, is there?
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Re: API question, change order of contents in a queue item?

Post by Usenet »

shypike wrote: Implicating that the sorting doesn't happen in "streaming mode"?
yes,
shypike wrote: If the sorting works properly, there isn't a real need to fiddle with the API, is there?
No, but when looking at the code it looks like something like  "/nzb/SABnzbd_nzo_xxxxx/bulk_operation/?_dc=XXXX&session=XXXX&action_key=nzo-top&SABnzbd_nzf_xxxx=on"....
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API question, change order of contents in a queue item?

Post by shypike »

I'll check the sorting, it should sort always.

What you show is not the API, but the link-based support for templates.
Not really usable for your purpose.
BTW: the difference between the API and the TAPI is that the
API needs explicit authentication and the TAPI assumes that the browser
has already logged into the UI.
The functionality of the two is identical.
A large part of the interface between the program and the templates is outside the API/TAPI
and cannot be used by external programs.
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Re: API question, change order of contents in a queue item?

Post by Usenet »

Great, thanks for the clarification!
Post Reply