May 8, 201313 yr i'm looking to write a prequeue script for sabnzbd and i'm a little unsure of how to do something as i'm fairly new to linux in general. i thought i'd ask here as well as on the sab forum as there may be something peculiar to unraid that i should be aware of. I'm looking to have movies that are 2012 and later assigned a higher priority in my sab queue and looking to do it automatically. the bit i need help with is how to do the if (name of movie contains 2012 or 2013) bit of the script. any linux gurus here that can help ?
May 9, 201313 yr never used their prescripts but take a look here: http://wiki.sabnzbd.org/user-pre-queue-script looks like it passes 11 parameters as variable. these variables should be assigned numerically as such: $1, $2, $3, etc. it doesnt look like any of the parameters passed to the script show the year of the movie. so what i would do is this: first, check to make sure it is a movie by the category. then if it if, use a regex to find the date based on the name of the file. if you arent familiar with regex, you can do a little digging. im sure it would be easy enough to find the regular expression you want instead of making one yourself since a number of programs like sickbeard, xbmc, and sabnzbd all use a regex specific to scene release naming. then if the date is equal of grater to 2012, change the category.
May 10, 201313 yr Author got it working with some heavy googling and trial and error. #!/usr/bin/env bash curyear=`date +%Y` lastyear=$((`date +%Y` -1)) testyear=($lastyear,$curyear) if [[ $1 == *$testyear* ]] then case $3 in *movie*) priority="1" ;; *) priority="$5" ;; esac else priority="$5" fi echo "1" echo $1 echo $2 echo $3 echo $4 echo "$priority" echo $6 echo $7
Archived
This topic is now archived and is closed to further replies.