use first folder name

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
brinkdadrink
Donor
Posts: 4
Joined: 01 Apr 2017, 19:34

use first folder name

Post by brinkdadrink »

I am trying to figure out how to use filebot to keep a folder structure.

If i have
/mnt/temp/Movies/movie name.mkv
/mnt/temp/Camera/movie name.avi

how can I use the movie format to place correctly to get
/mnt/library/Movies/movie name (year)/movie name (year)
/mnt/library/Camera/movie name (year)/movie name (year)

using amc

i have:

Code: Select all

filebot -script fn:amc --output "/mnt/plex" -non-strict --action move --conflict auto --def reportError=y --def deleteAfterExtract=y --def clean=y --def unsorted=y --def storeReport=y --def "exec=chmod 775 -R '{folder}' && chown -R user:group '{folder}'" --def movieFormat="Movies/{n.colon(' ')} ({y})/{n.colon(' ')} ({y}){' CD'+pi}{'.'+lang}" seriesFormat="{plex}" /mnt/library --log-file amc.log
basically i need to change --def movieFormat to something like
--def movieFormat="{parent folder}/{n.colon(' ')} ({y})/{n.colon(' ')} ({y}){' CD'+pi}{'.'+lang}"
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: use first folder name

Post by rednoah »

1.
I recommend using the Format Editor GUI to prototype formats:
http://www.filebot.net/naming.html


2.
e.g. use folder name

Code: Select all

{folder.name}/{plex}
e.g. take path component 0, 1 and 2 from the original folder structure, and then add the rest according to your preferences:

Code: Select all

{f[0..2]}/{plex}
e.g. keep bits and pieces from the original path:

Code: Select all

{f.path.match(/Movies|Camera/)}/{plex}
:idea: Please read the FAQ and How to Request Help.
Post Reply