New option "On queue finish"

Want something added? Ask for it here.
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

New option "On queue finish"

Post by KeesC »

Hi,

I would like the PC to do things after the download has finished, One thing is to run my backup schedule and shutdown the PC.

Therefor I would like to see a new option in "On queue finish": the possibility to run a bat file. Then I can do whatever I like after the downloads.

Thanks,
Kees.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

It's already possible. Just put the bat file in the Scripts folder and then click the hamburger menu icon, in the main interface, at the bottom you can select the script.
This action will be performed once, to make the script run every time you need to enable the Special setting queue_complete_pers.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

OK, thanks, I will check that.
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

I checked, but I can't select the bat file.

I have Test.bat in the scripts folder (besides Sample-PostProc.cmd / py / sh), but the On queue finish - pulldown shows the previous 4 options (shutdown Sabnzbd, shutdown PC, standby PC, hybernate PC).

What do I do wrong?
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

See the wiki:
On Windows, the requirement is that the script's extension is listed in your system's PATHEXT environment variable.

So make sure bat is listed in there.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

I checked:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

I checked the WIKI and discoverd that I must fill in "Script Folder" in Config-Folders.
Now I see the scripts and my bat file in the Queue Finish pull down.

Thanks for pointing me in the right direction.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

Ah yes of course. Just make sure you haven't put the script in the Program Files/SABnzbd directory, as each new update of SABnzbd will remove that folder.
Put it somewhere in your user folders and point SABnzbd to there!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

Yes, I pointed to my tools-folder. Windows 10 does not allow me to change much in the standard Sabnzb installation folders.

Thanks again!
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

Well, it is not working as expected. I chose the bat file and it works after the downloads have finished.

But the selection remains active, even over restarts of the PC. And I have not the option to clear the on-queue-finished selection, only the option to select something.

What should I do?
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

If you disable queue_complete_pers it will only be executed once.

What is your script trying to do?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

Queue_complete_pers is OFF.
At this moment it does nothing, it used to restart the PC.

In the hamburger menu I can *set* an action for an emtpy queue, how can I clear the action?
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

Pick the most top option, it should be an empty one.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
KeesC
Newbie
Newbie
Posts: 22
Joined: December 31st, 2018, 9:44 am

Re: New option "On queue finish"

Post by KeesC »

Ok, yes that works. I did'nt notice it was an empty selection.

Why is my bat file not a one-time action?
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: New option "On queue finish"

Post by safihre »

Oh, it seems I am wrong.
For some reason scripts are always persistent while other options (like Shutdown PC) are reset after being fired, so indeed the script will run every time.
This seems quite strange to me.. but has been like this since a longggg time, so not sure if I can just fix it.

For now a ugly solution would be to call in your script the API with set_config and set "queue_complete" to empty.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply