I've been playing around with the naming schemes for renaming my movies.
Came across the {az} which is handy for getting the first letter of the title but i'm trying to work out how can I encorporate if statements, to move the movies into folders, based off the file structure below.
Essentially, if the movie starts with a numeric no of 0-9 then put in the 0-9 folder. If {az} is between A-E then put it inside that folder, then the correct single letter folder below.
I could make it easier and just use the straight az and move all the A to Z folders up to the root directory, but i'd still need an if statement / naming to sort out the movies starting with 0-9. This is the main bit i'm stuck with.
Any assistance would be apprciated. Thanks.
├───0-9
├───A-E
│ ├───A
│ ├───B
│ ├───C
│ ├───D
│ └───E
├───F-J
│ ├───F
│ ├───G
│ ├───H
│ ├───I
│ └───J
├───K-O
│ ├───K
│ ├───L
│ ├───M
│ ├───N
│ └───O
├───P-T
│ ├───P
│ ├───Q
│ ├───R
│ ├───S
│ └───T
│
└───U-Z
├───U
├───V
├───W
├───X
├───Y
└───Z
Using az sort with If then
Re: Using az sort with If then
e.g.
Note that {az} will return "0-9" by default (and not just a single digit) for movie / series / collection names that start with a digit.
Format: Select all
{
switch(az) {
case 'A'..'E': return 'A-E'
case 'F'..'J': return 'F-J'
case 'K'..'O': return 'K-O'
case 'P'..'T': return 'P-T'
case 'U'..'Z': return 'U-Z'
case '0-9': return '0-9'
default: return '###'
}
}

Re: Using az sort with If then
Legend. Thanks a lot for that. I'd prefer not to double up on the 0-9 folders, so I've edited / added to it to repeat a switch again but for the next folder, to determine the letter or add nothing if the az = a digit. Once I add the folder path at the start, with other naming convention stuff at the end, it seems to have done the trick.rednoah wrote: ↑29 Apr 2022, 20:04 e.g.Code: Select all
{ switch(az) { case 'A'..'E': return 'A-E' case 'F'..'J': return 'F-J' case 'K'..'O': return 'K-O' case 'P'..'T': return 'P-T' case 'U'..'Z': return 'U-Z' case '0-9': return '0-9' default: return '###' } }
Note that {az} will return "0-9" by default (and not just a single digit) for movie / series / collection names that start with a digit.
EG:
Code: Select all
switch(az) {
case 'A'..'E': return 'A-E/'
case 'F'..'J': return 'F-J/'
case 'K'..'O': return 'K-O/'
case 'P'..'T': return 'P-T/'
case 'U'..'Z': return 'U-Z/'
case '0-9': return '0-9/'
default: return '###'
}
}{
switch(az) {
case 'A'..'Z': return az
case '0-9': return ''
default: return '###'
}
/PATH/A-E/A/Avengers (A movie starting with A)
/PATH/0-9/300 (A movie starting with a digit)
Thanks again!
Re: Using az sort with If then
e.g.
Format: Select all
{
switch(az) {
case 'A'..'E': return 'A-E' / az
case 'F'..'J': return 'F-J' / az
case 'K'..'O': return 'K-O' / az
case 'P'..'T': return 'P-T' / az
case 'U'..'Z': return 'U-Z' / az
default: return '0-9'
}
}
Re: Using az sort with If then
Yeah, or that. That's much cleaner tbh. Thanks 
