Page 1 of 1

Using the 3D regex example

Posted: 26 Sep 2014, 18:12
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"

Re: Using the 3D regex example

Posted: 26 Sep 2014, 18:23
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'}

Re: Using the 3D regex example

Posted: 26 Sep 2014, 18:46
by skinsvpn
Will {fn =~ /3D/ | /3d/ ? 'Movies - 3D' : 'Movies'} remove the case sensitivity?

Edit: {fn =~ /3D|3d/ ? 'Movies - 3D' : 'Movies'} works.

Re: Using the 3D regex example

Posted: 27 Sep 2014, 02:23
by rednoah
You can use the regex case-insensitive switch:

Code: Select all

/(?i)3D/