Ability to pause all queued items without pausing the entire program...

Want something added? Ask for it here.
Post Reply
lpmccracken
Newbie
Newbie
Posts: 7
Joined: June 29th, 2010, 4:29 pm

Ability to pause all queued items without pausing the entire program...

Post by lpmccracken »

... or have a manageable queue.

Let's say I have a large queue & I only download during a certain time of day, but once in a while I want to download something during the off time.  Currently, I have to manually pause every item in the queue, then resume the main program, then download the one or two items I want to download right now, then pause the main program, then manually resume every paused queue item.  This seems like a lot of hoops to jump through.

Command line access to this is preferred: issue one command to pause all queue items, but keep the main program up & running & ready for new queue items, one command to resume all queue items.

The inability to retrieve queued nzb files makes the current program difficult to handle; it seems to be on or off with no convenient in between.  hellanzb leaves queued files in a folder & picks out one at a time.  It's really, really easy to shutdown hellanzb to stop the downloading, then simply move those queued files out of the watched directory & put them somewhere temporary, then put them back in the watched directory at a later time.  It's also really, really easy to keep hellanzb running & move the currently queued files out of the watched directory.  That way the program can keep running & await new files I want to queue up without having to jump through any hoops.

Maybe the solution is to have a queue like hellanzb.  That code exists & must be under some friendly license for borrowing.  Maybe there could be a switch to choose what type of queue I want to use: the current take-all-the-files-&-have-a-mystery-queue-without-any-real-way-of-getting-at-the-nzb-files, or an hellanzb-like queue.

Thanks.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Ability to pause all queued items without pausing the entire program...

Post by shypike »

You can do a lot using our API.
See: http://wiki.sabnzbd.org/api

You cannot have much programming experience if you think that
combining two programs with a completely different design philosophy is easy.
Besides, it seems you already have found the perfect program.
lpmccracken
Newbie
Newbie
Posts: 7
Joined: June 29th, 2010, 4:29 pm

Re: Ability to pause all queued items without pausing the entire program...

Post by lpmccracken »

Thanks for the heads up about the api.

Fair enough about combining two programming designs.  I haven't looked at your code yet, but it may be possible to implement a queue that picks out one nzb from a directory at a time.  The total queue size & total time left would probably be lost, but that's fine with me.  Maybe it's a six of one & half dozen of the other situation.  You say, "potato," I say"potato."

Maybe it would be possible to have a "Retrieve Queue" button that would take the backed up nzb files for queue items out of the backup folder & put them in a different location.  Now that I've experimented with the api a bit, I'm sure it's possible to retrieve the queue with an external script.

I hope I didn't come across as an asshole who's hell bent on requesting that  sabnzbd+ be turned into a clone of hellanzb.  I like the way hellanzb does some things & think if sabnzbd+ could do them too (in addition to the way it already does things thereby giving the end user tonnes of choices), that would make sabnzbd+ an even greater program.

Thanks again.
lpmccracken
Newbie
Newbie
Posts: 7
Joined: June 29th, 2010, 4:29 pm

Re: Ability to pause all queued items without pausing the entire program...

Post by lpmccracken »

Here's a quick script that takes advantage of the api & does exactly what I was looking for:

Code: Select all

#!/bin/bash
#
# ssabnzbd-queue-manager.sh
#
# This script pauses or resumes all queued nzb files in sabnzbd+.
#
# It takes either a -p to pause or -r to resume 

TMP_FILE=`mktemp -p /dev/shm ssab-tmp.XXXXXXXX`
ACTION=""

if [ "$1" == "-p" ]; then
	ACTION="pause"
elif [ "$1" == "-r" ]; then
	ACTION="resume"
else
	echo "Usage: ssabnzbd-queue-manager.sh -{p,r}"
	echo "  p to pause & r to resume"
	rm $TMP_FILE
	exit
fi

wget -q -O $TMP_FILE "http://<your_host>:<your_port>/sabnzbd/api?apikey=<your_key>&mode=qstatus&output=xml"
cat $TMP_FILE | grep '<id>' | sed -e 's/<id>//g' -e 's/<\/id>//g' | while read line1; do wget -q "http://<your_host>:<your_port>/sabnzbd/api?apikey=<your_key>&mode=queue&name=$ACTION&value=$line1"; done

rm $TMP_FILE
Be sure to replace , , & .  Give this a crontab entry & you're laughing.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Ability to pause all queued items without pausing the entire program...

Post by shypike »

No offence taken.
I'm not always in the right mood to be very patient :)
Post Reply