Page 1 of 1

Expression format problem

Posted: 18 Oct 2019, 05:03
by schmitty
Hi,

Using the following expression:

Code: Select all

filebot -rename -r /rips/tv/Friends/Season\ 01/*.mkv --q "Friends" --db TheMovieDB::TV --action copy --format /rips/tv/{n}\ \({y}\){'/Season '+s}/{n}.{s00e00}.h264-AVC.{bitdepth}\ bit.{ac}\ \[{channels}\].{source}-{vf}
Yields the following error:

Code: Select all

SyntaxError: unexpected char: 0xFFFF
javax.script.ScriptException: SyntaxError: unexpected char: 0xFFFF
	at net.filebot.format.ExpressionFormat.compile(ExpressionFormat.java:85)
	at net.filebot.format.ExpressionFormat.<init>(ExpressionFormat.java:43)
	at net.filebot.format.ExpressionFileFormat.<init>(ExpressionFileFormat.java:13)
	at net.filebot.cli.ArgumentBean.getExpressionFileFormat(ArgumentBean.java:255)
	at net.filebot.cli.ArgumentProcessor.runCommand(ArgumentProcessor.java:124)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:33)
	at net.filebot.Main.main(Main.java:132)

Error (o_O)
It seems to be the

Code: Select all

{'/Season '+s}
portion of the expression failing, as the expression works fine by hard coding the season directory. FWIW, I have even tried using

Code: Select all

{'/Season '+s.pad(2)}
and results in the error

Code: Select all

-bash: syntax error near unexpected token `('

Re: Expression format problem

Posted: 18 Oct 2019, 05:27
by rednoah
You're accidentally mixing bash code and Groovy code without knowing which code is interpreted by whom.

The solution is to pass format expressions via text files instead of passing them on the command line (where bits and pieces my be interpreted by bash without you being aware) or by escaping and quoting things correctly.

Re: Expression format problem

Posted: 18 Oct 2019, 06:00
by schmitty
Is there an FAQ or something about passing format expressions via text file?

Re: Expression format problem

Posted: 18 Oct 2019, 07:53
by schmitty
Never mind. I was able to solve it, with a bit of trial and error, and referring to different guides.

Here is the working expression:

Code: Select all

filebot -rename -r /rips/tv/Friends/Season\ 01/*.mkv --q "Friends" --db TheMovieDB::TV --action copy --format "/rips/tv/{n} ({y}){'/Season '+s.pad(2)}/{n}.{s00e00}.h264-AVC.{bitdepth} bit.{ac} [{channels}].{source}-{vf}"