"Uncut" two times in the name

All about user-defined episode / movie / file name format expressions
Post Reply
OOmatrixOO
Posts: 10
Joined: 29 Jun 2014, 09:01

"Uncut" two times in the name

Post 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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Uncut" two times in the name

Post 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()
:idea: Please read the FAQ and How to Request Help.
OOmatrixOO
Posts: 10
Joined: 29 Jun 2014, 09:01

Re: "Uncut" two times in the name

Post by OOmatrixOO »

Oh wow its so easy. Thank you, it works perfect.
Post Reply