Dealing with spaces in media tags.

Any questions? Need some help?
Post Reply
tekforty
Posts: 1
Joined: 03 Jul 2019, 05:40

Dealing with spaces in media tags.

Post by tekforty » 03 Jul 2019, 06:54

Hopefully this is a quick syntax fix.

I have the following command line:

Code: Select all

"C:\Program Files\FileBot\filebot.exe" -rename D:\Filebot\Original --db file --format "{media.ContentType}/{media.Collection.replaceAll(/[:|]/, \"_\")}/Season {media.Season.pad(2)}/{media.Collection.replaceAll(/[:|]/, \"_\")} - S{media.Season.pad(2)}E{media.Part.pad(2)} - [b]{media.Track name}[/b]" --action test --output D:\Filebot\New --log-file D:\Filebot\log.txt
What's causing me trouble is the {media.Track name} in the command line above. The media tag does indeed have a space in it however, the command line is not handling the space properly and is giving me the error below. Anyone know the syntax to correct this?

Code: Select all

D:\Filebot>filebot
Locking D:\Filebot\log.txt
SyntaxError: unable to resolve class media.Track

javax.script.ScriptException: SyntaxError: unable to resolve class media.Track

        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)

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

Re: Dealing with spaces in media tags.

Post by rednoah » 03 Jul 2019, 09:18

Assuming there's a MediaInfo property named "Track Name" any of these will work:

Code: Select all

media.TrackName

Code: Select all

media.Track_Name

Code: Select all

media.'Track Name'

Code: Select all

media['Track Name']
:idea: Please read the FAQ and How to Request Help.

Post Reply