ena30 / snake-os

Automatically exported from code.google.com/p/snake-os
0 stars 0 forks source link

Transmission queue. #207

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've noticed that transmission does not have support for downloads queue. I 
guess it would be nice to have a option to set how many simultaneously 
downloads are allowed, and any other started after that limit, would be 
automatically in queue. When the download finishes, it moves to the next one in 
queue.

What version of the product are you using? On what operating system?
I'm using the snakeos-V1.3.2-20101130-from-original.bin 

Thanks a lot!

Original issue reported on code.google.com by psych...@gmail.com on 26 Sep 2011 at 3:06

GoogleCodeExporter commented 8 years ago
doesnt work 100% of the time if anyone wants to clean up.

Its a nasty hack but this is how ive got around this queue problem. Create a 
queue folder, when a torrent completes move at random file from queue to 
torrentwatch by updating 
/var/transmission/.config/transmission-daemon/settings.json
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/usb/{your directories}/torrentend.sh",

torrentend.sh
#! /bin/sh

dir='/var/transmission/queue'
n_files=`/bin/ls -1 "$dir" | wc -l | cut -f1`
if test $n_files -ne 0
then
  rand_num=`awk "BEGIN{srand();print int($n_files * rand()) + 1;}"`
  file=`/bin/ls -1 "$dir" | sed -ne "${rand_num}p"`
  path=`cd $dir && echo "$PWD/$file"` # Converts to full path.
  echo "The randomly-selected file is: $path"
  logger $path copied to torrentwatch folder
  mv $path /var/transmission/torrentwatch
fi

logger $1 completed

Original comment by g1p...@gmail.com on 10 Oct 2011 at 11:03