[AMC] Sort files into folders based on current file path

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
WtfJoke
Posts: 7
Joined: 13 Dec 2014, 02:44

[AMC] Sort files into folders based on current file path

Post by WtfJoke »

Hi there.

Wasnt sure if I should post this here or Help & Support.
I run from time to time amc and it works great.
However there is some small detail I would like to know.

I use following command:
date '+%D %X'
filebot -script fn:amc --lang de --output "/volume1/Freigabe/Series & Movies" --log-file amc.log --action move -non-strict "/volume1/Freigabe/DL" --def excludeList=amc.txt "seriesFormat=Serien/{n}/{'Staffel '+s}/{n}.{s00e00} - {t}/{folder.name}/{fn}" "movieFormat=Movies/{n} ({y})/{folder.name}/{fn}" xbmc=openelec

As you can see all my movies/tv-shows are downloaded into a folder DL. Half my stuff gets extractet into separate folder for example MyTVShow.DVDRip.AC3.DL in this case the above command runs perfectly fine (and translate it to MyTVShow\Season 01\MyEpisode1\MyTVShowDVDRip.AC3.DL\s01 - e01.avi).

But sometimes its not into a separate folder and foldern.name will translate to DL and this behaviour I would like to avoid.

My question is now can I somehow omit the folder.name variable under some circumstances?
Or is it possible depending on the folder name variable to run two different commands (e.g one with folder.name and one without).

Pseudo-Code:
if folder.name is DL
do command without folder.name
else
do command like above

Hope somebody understands my description and can help.
Thanks in advance!
User avatar
rednoah
The Source
Posts: 23143
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] Detail-Question for omit of parameters

Post by rednoah »

Have you had a look at the examples? Plenty of conditional statements there.

e.g.

Code: Select all

{folder.name == 'DL' ? folder.name+'/' : ''}
:idea: Please read the FAQ and How to Request Help.
WtfJoke
Posts: 7
Joined: 13 Dec 2014, 02:44

Re: [AMC] Detail-Question for omit of parameters

Post by WtfJoke »

I only checked out the cli page and some examples mentioned in the scripts. Didnt see them there :oops:

Thanks for the fast reply. I'll give it a try. But looks very straightforward. :D

EDIT:
I managed it the following way:
filebot -script fn:amc --lang de --output "/volume1/Freigabe/Series & Movies" --log-file amc.log --def skipExtract=y --action move -non-strict "/volume1/Freigabe/DL" --def excludeList=amc.txt "seriesFormat=Serien/{n}/{'Staffel '+s}/{n}.{s00e00} - {t}/{folder.name == 'DL' ? '' : folder.name}/{fn}" "movieFormat=Movies/{n} ({y})/{folder.name == 'DL' ? '' : folder.name}/{fn}" xbmc=openelec
Post Reply