Page 1 of 1

Email Template $status

Posted: March 16th, 2010, 3:42 am
by Eejit
Version: 0.5.0 Final
OS: Windows 7 Pro
Install-type: Windows Installer
Skin: Default
Firewall Software: Avast
Are you using IPV6? no
Is the issue reproducible? yes

I've just started playing with the email templates and have noticed a possible problem with the $status variable.
It would only seem to be based only on verification stage. Should a job pass the verification, but fail the unpack stage for whatever reason, TRUE is still returned.
This would also appear to be true of the folder renaming. ie _FAILED_ is not given if the unpacking fails due to a password etc.

Unless I misunderstand, which wouldn't be the first time  ;D

Re: Email Template $status

Posted: March 16th, 2010, 4:14 am
by shypike
The status should be 0, 1, 2 or 3 (OK, failed verification, failed-unrar, failed verification+failed unrar).
But it's not implemented correctly.
It is done right for user scripts but not for email templates.

I'll fix this in  0.5.1.

Looking at the source code, I'd say that the renaming works OK.
However: if you have "pp only verified jobs" off, the "__FAILED__" prefix is always removed,
despite a failed unrar.
This is intentional, although it may not be what you like or expect.

Re: Email Template $status

Posted: March 16th, 2010, 6:19 am
by Eejit
Thanks shypike,
I look forward to 0.5.1  :)

The failed prefix is strange as I had "Post-Process Only Verified Jobs" selected.

I'll try with it off, then turn it back on again and check the results.

Re: Email Template $status

Posted: March 16th, 2010, 6:51 am
by shypike
This is not consistent with what you said earlier.
Given your setting, you will never get a "failed unrar" status,
because SABnzbd will not try to unpack.
Although the code is incorrect, that's not what is causing your observation.

I'll have a look at the renaming issues too.

Re: Email Template $status

Posted: March 16th, 2010, 11:57 am
by Eejit
My nick is just more than a nick  ;)
As I now understand it:
If "Post-Process Only Verified Jobs" is selected, the Failed prefix will never be given for a failed unrar but will be given for failed verification.
If I want the Failed prefix for all failed downloads, from all stages I should leave the "Post-Process Only Verified Jobs" unselected.
I'll have to find an nzb to test.

Cheers

Re: Email Template $status

Posted: March 16th, 2010, 1:04 pm
by shypike
Testing is easy enough. Just load an NZB and remove enough files from the list :)
Please note that using the sorting options may partially defeat the folder flagging.

BTW: I'm not going to change the code for email $status.
The problem is that it would invert the meaning of $status.
Currently "1" success and "0" is (any) failure.
It will stay this way, I don't think the problem is big enough to invert
the meaning of the $status field.