Using the 3D regex example

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
skinsvpn
Posts: 13
Joined: 26 Sep 2014, 11:46

Using the 3D regex example

Post by skinsvpn »

I am using the example format expression to put 3D movies into a separate folder but I think I may be doing something wrong.

The format expressions is: {fn =~ /3D/ ? 'Movies - 3D' : 'Movies'}/{n} ({y}){fn =~ /3D/ ? ' [3D] [H-SBS]' : ''}/{n} ({y}) ({vf}){fn =~ /3D/ ? ' H-SBS' : ''}{' CD'+pi}

It is working for any torrents with 3D and HSBS in the title but not ones with merely 3D. Am I using this wrong or is this a coincidence and I am doing something different wrong?

My full command:
filebot -script amc.groovy --output "V:" --log-file amc.log --action move --conflict override -non-strict --db TheMovieDB --def "movieFormat={fn =~ /3D/ ? 'Movies - 3D' : 'Movies'}/{n} ({y}){fn =~ /3D/ ? ' [3D] [H-SBS]' : ''}/{n} ({y}) ({vf}){fn =~ /3D/ ? ' H-SBS' : ''}{' CD'+pi}" plex=localhost "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S"
User avatar
rednoah
The Source
Posts: 21496
Joined: 16 Nov 2011, 08:59

Re: Using the 3D regex example

Post by rednoah »

It clearly checks the file name (not the folder, or the path) for "3D" (in capital letters) and it does not at all check for "HSBS"

Code: Select all

{fn =~ /3D/ ? 'Movies - 3D' : 'Movies'}
:idea: Please read the FAQ and How to Request Help.
skinsvpn
Posts: 13
Joined: 26 Sep 2014, 11:46

Re: Using the 3D regex example

Post by skinsvpn »

Will {fn =~ /3D/ | /3d/ ? 'Movies - 3D' : 'Movies'} remove the case sensitivity?

Edit: {fn =~ /3D|3d/ ? 'Movies - 3D' : 'Movies'} works.
User avatar
rednoah
The Source
Posts: 21496
Joined: 16 Nov 2011, 08:59

Re: Using the 3D regex example

Post by rednoah »

You can use the regex case-insensitive switch:

Code: Select all

/(?i)3D/
:idea: Please read the FAQ and How to Request Help.
Post Reply