Page 1 of 1

[amc] Change output folder dynamically

Posted: 06 Aug 2016, 18:45
by Grimshad
So I downloaded amc.groovy to edit it locally.

I need two different output folders depending on the year.

So I tried to add a new switch and no matter what i do it says invalid option. So I just statically assigned my second ouput folder in the script.

Then I setup an if statement which basically says if the mov.year matches the current year then the outputFolder is the second output folder, else it's the first one.

I debugged the code and it's working fine, but eveything still goes to the output folder in the args. All of this must be happening in filebot and not in the script.

So how can I change the output folder dynamically within the script. Since everything seems to be hardcoded, or at least i can't seem to find any exposed variables or how to change them.

Re: changing amc

Posted: 06 Aug 2016, 20:22
by rednoah
The output path for each file is entirely defined by the format. You can pass in your own series/movie formats on the command-line if you don't like the defaults. No need to modify the amc script.

e.g.

Code: Select all

--def "seriesFormat=S:/TV/{n}/{fn}" "animeFormat=T:/Anime/{n}/{fn}" "movieFormat=M:/Movies/{ny}/{fn}" "musicFormat=N:/Music/{n}/{fn}"

Re: [amc] Change output folder dynamically

Posted: 07 Aug 2016, 15:31
by Grimshad
This doesn't solve my problem though. Assume i'm only processing movies, here's an example:

If I have:
Movie 1 (2004).mp4
Movie 2 (2015).mp4
Movie 3 (2016).mp4


The final folder structure should be:

A:\Movies\2004\Movie 1 (2004)\Movie 1 (2004).mp4
A:\Movies\2015\Movie 2 (2015)\Movie 2 (2015).mp4
B:\Movies\2016\Movie 3 (2016)\Movie 3 (2016).mp4

If the year of the movie is the current year, it goes to one location, if not, it goes to another location. The folder structure is easy, but it does not allow me to change the destination folder based on year, or specify 2 destination folder, or even 1 dynamic destination folder.

Re: [amc] Change output folder dynamically

Posted: 07 Aug 2016, 16:07
by rednoah
Your format will create a path. If that path is relative it will be resolved against the --output folder. If your format creates an absolute path, then --output as no effect on the final output path for a given file (you still need to set the --output folder for other reasons though).


You might use the FileBot Format Editor (GUI) to prototype a format such as this:

Code: Select all

{y > 2015 ? 'B' : 'A'}:/Movies/{y}/{ny}/{ny}
Once you've come up with a format you like, you can pass it to the amc script via the format options.

Re: [amc] Change output folder dynamically

Posted: 07 Aug 2016, 16:29
by Grimshad
I didn't realize I could have conditionals in the format. Where is this gui format editor you speak of?

Re: [amc] Change output folder dynamically

Posted: 07 Aug 2016, 16:33
by rednoah
Here's the manual:
http://www.filebot.net/naming.html

Here's lots of more advanced examples: viewtopic.php?f=5&t=2