Weenyhead wrote:Little late to this party, but in case someone finds this page like I did, here's the solution I came up with:
Set a different "move to location" (directory) for each label.
Then in your execute script you can check that directory (the path variable).
example:
Code: Select all
#!/bin/bash
torrentid=$1
torrentname=$2
torrentpath=$3
if [ $torrentpath == "/home/vpn/Downloads/complete/tv" ] ; then
# do something to tv downloads
elif [ $torrentpath == "/home/vpn/Downloads/complete/movie" ] ; then
# do something to movie downloads
else
# do something with all other downloads
fi
Hope that helps
To expand on the late party - I've just set up exactly what OP wants using your post as guidance, so thank you! I thought I'd come and share the finished result to hopefully help others.
So just like Weenyhead said, you can achieve this pretty easily with the example here for an if, elif, else, fi scipt with the downloaded location as the variable, rather than trying to do it on a per label basis. I choose to also package the filebot commands into .sh scripts for ease of use, but you can do it how you like.
Code: Select all
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH="/snap/bin:$PATH"
export DISPLAY=:0
torrentid=$1
torrentname=$2
torrentpath=$3
if [[ $torrentpath == "/media/storage/Downloads/TVToProcess" ]] ; then
bash /home/pixelburst/bin/tv.sh
bash /home/pixelburst/bin/cleantv.sh
elif [[ $torrentpath == "/media/storage/Downloads/AnimeToProcess" ]] ; then
bash /home/pixelburst/bin/anime.sh
bash /home/pixelburst/bin/cleananime.sh
elif [[ $torrentpath == "/media/storage/Downloads/MoviesToProcess" ]] ; then
bash /home/pixelburst/bin/movies.sh
bash /home/pixelburst/bin/cleanmovies.sh
else
:
fi
So this is the main script, the one you point at from the execute plugin. As you can see I have tv.sh, anime.sh and moviessh downloading into 3 different folders as set up via RSS and watched folders - hence this script looks for them upon a torrent completing to check the path. If it matches TVToProcess/AnimeToProcess/MoviesToProcess it then executes the relevant script. For examples sake, we'll say it matches TVToProcess.
else
:
is very important here as it essentially tells it to do nothing if a completed torrent don't match those folders.
tv.sh looks like this -
Code: Select all
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH="/snap/bin:$PATH"
export DISPLAY=:0
filebot -rename "/media/storage/Downloads/TVToProcess" --format "/media/storage/Media/TV Shows/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" -non-strict -r --db TheTVDB
this does the filebot renaming - modify the script and format for each desired. Then finally it runs cleantv.sh which looks like so -
Code: Select all
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH="/snap/bin:$PATH"
export DISPLAY=:0
filebot -script fn:cleaner --def exts="/jpg|jpeg|png|gif|nfo|xml|htm|html|log|srt|sub|idx|md5|sfv|txt|rtf|url|db|dna|log|tgmd|json|data|srv|srr|nzb|z|aria*|torrent|par\d+|part\d+/" /media/storage/Downloads/TVToProcess
this cleans up any leftovers. Easy!