Running FileBot from the console, Groovy scripting, shell scripts, etc
stork
Posts: 4 Joined: 26 Jul 2013, 09:21
Post
by stork » 26 Jul 2013, 09:37
hi,
I use this script:
http://www.filebot.net/scripts/sorty.groovy and would like to exclude some files before
Code: Select all
// fetch subtitles
files += getSubtitles(file:files)
Essentially moving them immediately with
Code: Select all
rename(file:files, db:'TVRage', format:episodeFormat, strict:false)
before subtiltes are fetched.
what would be the way to go here?
stork
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 29 Jul 2013, 12:39
The variables files is a list of files that gets passed into each of those filebot functions. So just add some code for filtering the list you pass into any of those functions.
stork
Posts: 4 Joined: 26 Jul 2013, 09:21
Post
by stork » 30 Jul 2013, 14:01
Sure, but I'm a bit overwhelmed in regard to groovy. is "files" a predefined list or can I do something like
Code: Select all
def subs = files{
!(it =~ /(?i:Futurama.)/) \
&& !(it =~ /(?i:Family Guy.)/) \
}
// fetch subtitles
subs += getSubtitles(file:subs)
rename(file:subs, db:'TVRage', format:episodeFormat, strict:false)
right now this throws some (for me) unintelligible errors..
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 30 Jul 2013, 17:10
You'll need to check the code on where the input file list comes from.
Looking at your code I guess you get the basic idea but don't really get groovy collections:
http://groovy.codehaus.org/Collections
e.g.
Code: Select all
def words = ['ant', 'buffalo', 'cat', 'dinosaur']
assert words.findAll{ w -> w.size() > 4 } == ['buffalo', 'dinosaur']