I have a script I was trying to use. That would move renamed movie to a drive based on the first letter of the movie title. Ex: Firefox so would move it to the drive that houses movies with starting letters of d-h. So drive E is for movies with zero- C; drive F is for movies D-H; drive G for I-M.
My CLI script is:
I:\
F:\
[n =~ /^(?i) (0-9a-c)/ ? 'M:\' : n =~ /^(?i) (d-h)/ ? 'K:\' : n =~ /^(?i) (i-m)/ ? 'J:\' : n =~ /^(?i) (n-s)/ ? 'L:\' : n =~ /^(?i) (t)/ ? 'E:\' : 'D:\' }
This script creates a directory that is like 20 layers deep to the movie title.
So can the CLI use something like the script above to sort movies.
Thanks very much for answering.
Can CLI sort based on movie title
Re: Can CLI sort based on movie title
A simple if else statement "similar to the script you've posted" could possibly do just that.
something like although I'm not sure if that exact code will work as I've not tested it and I'm still new to the scene, but the logic is there.
--output="D:/" would be the default directory to place the file in case it doesn't match with any of the statements.
something like
Code: Select all
{(n =~ /^(?i) (0-9a-c)/ ) ? --output="E:/" : (n =~ /^(?i) (d-h)/ ) ? --output="F:/" : (n =~ /^(?i) (i-m)/) ? --output="G:/" : --output="D:/"}
--output="D:/" would be the default directory to place the file in case it doesn't match with any of the statements.
Re: Can CLI sort based on movie title
--output is a cmdline option and does not allow code. So if you wanna set it dynamically you'll have to use shell code.
What you want can easily be done by passing in your own format. Then you can use Groovy code to define your output path.
@see viewtopic.php?f=5&t=2#p51
What you want can easily be done by passing in your own format. Then you can use Groovy code to define your output path.
@see viewtopic.php?f=5&t=2#p51
-
- Posts: 6
- Joined: 20 Jan 2015, 06:59
Re: Can CLI sort based on movie title
Thanks I will try to play with the Groovy Code and see where that leads me.
Thanks again.
Thanks again.