Keeping 3D in file name

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Amishman
Donor
Posts: 56
Joined: 29 Dec 2013, 15:54

Keeping 3D in file name

Post by Amishman »

I found this script by Ithiel http://www.filebot.net/forums/viewtopic ... 1311#p7928 and I would like to incorporate it into my script but I'm having an issue.

This is what I am running from the CLI.

Code: Select all

filebot -script fn:amc --output "C:/test_output" --action test -non-strict "C:/test_input" --conflict override --def "seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}" "movieFormat=New Movies/{n} ({y}) {\"[$vf]\"}/{n} ({y})" --def clean=y --def plex=localhost {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}
This is the results.

Code: Select all

Parameter: seriesFormat = TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}/{n} {s00e00} {t}
Parameter: movieFormat = New Movies/{n} ({y}) {"[$vf]"}/{n} ({y})
Parameter: clean = y
Parameter: plex = localhost
Argument: C:\test_input
Argument: C:\Users\Amishman\{fn.contains('3D')
Exception: File not found: C:\Users\Amishman\{fn.contains('3D')
Failure (░_░)
Launch4j: Failed to run the given command.
I think it needs quotes since it wants to end at the space. I tried putting quotes in different places but I did get it right.
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: Keeping 3D in file name

Post by Ithiel »

Hi Amishman,

I'm not overly familiar with the AMC (that's more rednoah's thing), but at a guess, I think you might be having an issue with escaping quotes (or more accurately, quotes you need to escape).

Example of Escaped Quotes:

Code: Select all

\"[$vf]\"
I.e. I think that this:

Code: Select all

{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}
May need to be:

Code: Select all

{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}
Also... I'm pretty sure that the fn.contains and whatnot is meant to be part of the movie/episode format area as well.

Can you please try this and let me know if it works:

Code: Select all

filebot -script fn:amc --output "C:/test_output" --action test -non-strict "C:/test_input" --conflict override --def "seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}  {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'}" "movieFormat=New Movies/{n} ({y}) {\"[$vf]\"}/{n} {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'} ({y})" --def clean=y --def plex=localhost
There can be only one Power² User
Amishman
Donor
Posts: 56
Joined: 29 Dec 2013, 15:54

Re: Keeping 3D in file name

Post by Amishman »

Thank you Ithiel. That worked perfectly.
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: Keeping 3D in file name

Post by Ithiel »

sweet! glad it worked for you :-)

not bad for a lucky guess, if I do say so myself, lol.

maybe I should quickly go buy a lottery ticket while I'm at it :-P
There can be only one Power² User
Post Reply