Move movies on different drives depending on year

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Move movies on different drives depending on year

Post by Catmal »

My amc.sh script is

Code: Select all

filebot -script fn:amc --output "/mnt/Secondary" --def subtitles=en,it "seriesFormat=/mnt/TV Shows/TV Shows/{n}/Season {s}/{n} - {s00e00} - {t}{'.'+lang}" "movieFormat=/mnt/Secondary/Movies/{n} ({y}){'.'+lang}" --db OpenSubtitles --action move "/mnt/Secondary/Movies/Completed" -non-strict 
I would like movies to be moved on different drives depending on year.

For instance I have a drive /mnt/New Media/Movies/ where to place all movies that came out after 2012.
Or another one /mnt/Movies/Movies for movies that came out before year 2000.
And another /mnt/Movies 2/Movies for movies between 2000 and 2012.

How can i implement conditinal logic to move movies on correct drives?
Last edited by Catmal on 26 Jul 2018, 15:23, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move movies on different drives depending on year

Post by rednoah »

Sure, you can do something like this in your custom format.

e.g. expression:

Code: Select all

y < 2000 ? 'Pre-2000' : y < 2012 ? 'Pre-2012' : 'New Media'
e.g. format:

Code: Select all

/mnt/{y < 2000 ? 'Pre-2000' : y < 2012 ? 'Pre-2012' : 'New Media'}/{plex}
:idea: Please read the FAQ and How to Request Help.
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Re: Move movies on different drives depending on year

Post by Catmal »

I think I was not clear.

Let say I want all movies before 2012 to go to /mnt/Old Movies/Movies. /mnt/Old Movies is drive mounting point, Movies is the folder name. Movies will go in this folder without another folder for each single movie. Folder movies contains movie files. Final result is /mnt/Old Movies/Movies/Mission Impossible (1996).mkv.
All the other Movies should go to /mnt/New Movies/Movies. /mnt/New Movies/ is the mounting point and Movies is the folder. Final result is /mnt/New Movies/Movies/Unsane (2018).mkv.

Something like:

Code: Select all

filebot -script fn:amc --output "/mnt/New Movies" --def subtitles=en,it "seriesFormat=/mnt/TV Shows/TV Shows/{n}/Season {s}/{n} - {s00e00} - {t}{'.'+lang}" "movieFormat=/mnt/{y < 2000 ? 'Old Movies/Movies/{n} ({y}){'.'+lang}' : 'New Movies/Movies/{n} ({y}){'.'+lang}'}" --db OpenSubtitles --action move "/mnt/Secondary/Movies/Completed" -non-strict
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move movies on different drives depending on year

Post by rednoah »

Yep, my solution covers that. Just replace Pre-2000 in my example with Old Movies for your use case. What's unclear?

e.g.

Code: Select all

/mnt/{y < 2000 ? 'Old Movies' : 'New Movies'}/Movies/{n} ({y}){'.'+lang}
You can start with an {expression} if you want completely different paths for different files as well. Same concept applies:

Code: Select all

{y < 2000 ? '/volume1/Old Movies' : '/volume2/pool3/New Movies'}/Movies/{n} ({y}){'.'+lang}
:idea: You can of course write arbitrary code, or write your format as all code in a single {expression}, but that's not necessary in this simple use case, and would require basic Groovy skills.
:idea: Please read the FAQ and How to Request Help.
Catmal
Posts: 7
Joined: 18 Jul 2018, 12:06

Re: Move movies on different drives depending on year

Post by Catmal »

Right I misunderstood first example.

Works perfectly now. Thanks!
Post Reply