Page 1 of 1

Custom script

Posted: 30 Mar 2018, 13:18
by darkvinill
Hi, I'm using amc to process my files, movies & TV Shows are in {plex} format, and I'm using :

Code: Select all

--def exec="php cli.php filebot amcOnExec {quote fn} {quote file} {quote json}"
But there's a problem, I was expecting {quote fn} to return original file name but it is returning the new one.

Also --def exec= is being called for each file, even Unsorted ones. Is it possible to run "exec=...." only on successfully processed files ?

Re: Custom script

Posted: 30 Mar 2018, 14:36
by rednoah
{fn} is the current file name. {original} will give you the original file name. You can use {type} to check the info object type, and then do different things depending on the value.

Re: Custom script

Posted: 30 Mar 2018, 15:49
by darkvinill
I think you should update this page :
https://www.filebot.net/naming.html

{fn} says it's the "original filename" and there is nothing about {type} or {original}. (it would be nice to have a column called "Valid values")
Ex: {type} Valid values : Episode || Movie || Unsorted (?)

Re: Custom script

Posted: 31 Mar 2018, 11:57
by rednoah
You can use the built-in documentation Image while prototyping your format expression.

The best way to prototype expression is to have a couple of test files and test it on them. That way you'll see how you format works for various files.

You can use the Format Editor to prototype your --def exec expression.