Page 1 of 1

"Uncut" two times in the name

Posted: 29 Jun 2014, 09:21
by OOmatrixOO
Hello.
This is my Movie Naming Scheme:

Code: Select all

H:/{n =~ /^(?i)[a-z]/ ? n[0] : '#'}/{n.upperInitial()}{' (' + file.path.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'} ({y})
Sometimes a folder also has a subfolder, or in the folder name and the file name is for example "uncut".
"Uncut" is sometimes only in the filename. From time to time but only the folder name. Or even in the folder names, subfolder names and file names.

So the new name looks like this: H:/F/Frontiers (Uncut, Uncut) (2007)
What I have to change that then only once "uncut" , "extended", etc in the name is?

Thanks.

Re: "Uncut" two times in the name

Posted: 29 Jun 2014, 09:25
by rednoah
So you want a list of unique elements?
http://groovy.codehaus.org/groovy-jdk/j ... ique%28%29

Replace:

Code: Select all

.sort()
With:

Code: Select all

.sort().unique()

Re: "Uncut" two times in the name

Posted: 29 Jun 2014, 09:33
by OOmatrixOO
Oh wow its so easy. Thank you, it works perfect.