selective renaming of series name with {n.upperInitial()}

All about user-defined episode / movie / file name format expressions
Post Reply
hellraiser
Posts: 6
Joined: 19 May 2014, 04:30

selective renaming of series name with {n.upperInitial()}

Post by hellraiser »

There are many series where the naming goes

Game of Thrones, Through the Wormhole etc where I need the words like of,the to be lowercase only but {n.upperInitial()} changes all initials to uppercase

There are some series where all uppercase are needed. example - Last.Week.Tonight.With.John.Oliver.S01E11.HDTV.x264-BATV

here I need {n.upperInitial()} ( i.e. I need 'with' to be uppercase) but also want to add exceptions for 'of','the'

Is there any way I could do this?

Thanks!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: selective renaming of series name with {n.upperInitial()

Post by rednoah »

At this point why don't you just keep {n} untouched?

Hint:

Code: Select all

{'Game Of Thrones'.replace('Of','of')}
:idea: Please read the FAQ and How to Request Help.
hellraiser
Posts: 6
Joined: 19 May 2014, 04:30

Re: selective renaming of series name with {n.upperInitial()

Post by hellraiser »

At the moment it is just {n} :P but is there no except() function in groovy that would get the job done?

Code: Select all

{'Game Of Thrones'.replace('Of','of')}
This works for one time then I have to change...better I keep it only {n} and manually change one or two words
Post Reply