non-strict matching?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
perler
Posts: 6
Joined: 23 Jul 2012, 19:40

non-strict matching?

Post by perler » 23 Jul 2012, 19:44

hi,

I try to use this script: http://filebot.sourceforge.net/scripts/sorty.groovy (from the sticky thread on the top). but get

Code: Select all

Exception: Handling multiple shows requires non-strict matching
as soon as I have two different shows in the source directory?

also, I would like to change this line:

Code: Select all

def episodeFormat = "V:/out/TV/{n}{'/Season '+s}/{episode}"
in a way, that I get leading zeroes for the target directories (ie "breaking bad season 06" "instead of breaking bad season 6"

regards,

PAT

User avatar
rednoah
The Source
Posts: 16810
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: non-strict matching?

Post by rednoah » 24 Jul 2012, 00:59

1. Add -non-strict cmdline flag

2. Copy the script and make your changes, e.g. {s.pad(2)}
:idea: Please read the FAQ and How to Request Help.

perler
Posts: 6
Joined: 23 Jul 2012, 19:40

Re: non-strict matching?

Post by perler » 24 Jul 2012, 06:52

oh, I need to /copy/ the script?! ;)

thanks I had a look here: http://mrhaki.blogspot.de/2009/09/groov ... rings.html and don't really see yet how to put this into the line above. would you help a java noob?
also, can I put the -non-strict as a flag into the script itself, for portability?

User avatar
rednoah
The Source
Posts: 16810
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: non-strict matching?

Post by rednoah » 24 Jul 2012, 07:53

1. Well, you can't modify the scripts on my server right? :P

2. Copy that from almost any of my examples about formatting: {'/Season '+s} => {'/Season '+s.pad(2)}

3. Sure, you can set it for each call, e.g. rename(..., strict:false)
:idea: Please read the FAQ and How to Request Help.

perler
Posts: 6
Joined: 23 Jul 2012, 19:40

Re: non-strict matching?

Post by perler » 24 Jul 2012, 10:46

thanks, re 3., getting closer, this throws an exception:

Code: Select all

InvalidPathException: Trailing char < > at index 74: somefilepath..\The Daily Show\The Daily Show Season \The Daily Show - 17x127 - Faree
d Zakaria.mp4
btw, could you help out with a simple if then or case syntax in groovy to exclude certain shows along the line of

Code: Select all

rename if filename does not contains "The.Daily" 
preferable in some kind of easily editable list form? (or point me to an example you have already written).

thanks.

User avatar
rednoah
The Source
Posts: 16810
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: non-strict matching?

Post by rednoah » 24 Jul 2012, 14:58

1. You messed up your cmdline call somehow. What's the full cmdline call? Probably something to do with using \ and escaping something by mistake.

2. All the more complex scripts have some filtering going on like this. Learn by example. ;)

Code: Select all

input = input.findAll{ !(it.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/) }
Here's something like it but the other way around:
http://filebot.sourceforge.net/forums/v ... ?f=4&t=158
:idea: Please read the FAQ and How to Request Help.

perler
Posts: 6
Joined: 23 Jul 2012, 19:40

Re: non-strict matching?

Post by perler » 24 Jul 2012, 15:08

1. it's quite simple: C:\Program Files (x86)\FileBot>filebot.cmd -script c:\admin\scripts\tvhowssorter
_filebot.groovy

2. thanks, will have a look into it..

User avatar
rednoah
The Source
Posts: 16810
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: non-strict matching?

Post by rednoah » 24 Jul 2012, 18:23

1. You can't just use \ in the Groovy code. It's an escape character. Use / instead in paths, or \\ for a literal \.
:idea: Please read the FAQ and How to Request Help.

perler
Posts: 6
Joined: 23 Jul 2012, 19:40

Re: non-strict matching?

Post by perler » 24 Jul 2012, 18:43

that's the command line which calls the script, in the script itself the paths are written like this:

Code: Select all

def episodeDir    = "q:/Users/files/Videos/Current/#INCOMING"
maybe it's best to show you the script in itself, it's basically yours with some things not relevant to me commented out: https://dl.dropbox.com/u/152632/tvhowss ... bot.groovy

maybe you see a stupid mistake.

thanks!

perler
Posts: 6
Joined: 23 Jul 2012, 19:40

Re: non-strict matching?

Post by perler » 24 Jul 2012, 19:15

ok, found it, you have to put single quotes around spaces..

Post Reply