A little help with my naming script
Posted: 24 May 2020, 21:54
Hi Guys
I was very proud of how I managed cut up others code and chomp it together to get my naming convention.
I recently started using it on my new linux GCP VM but it would seem there is one part of this naming does not carry over very well (the "/" causes it to create a new sub folder).
Anyone able to help re jig this so that rather than a / it - or + or even just a space.
The other thing I would love to add is the ability to add [Director cut] [extended] etc...
Any help would be appreciated.
I was very proud of how I managed cut up others code and chomp it together to get my naming convention.
I recently started using it on my new linux GCP VM but it would seem there is one part of this naming does not carry over very well (the "/" causes it to create a new sub folder).
Anyone able to help re jig this so that rather than a / it - or + or even just a space.
The other thing I would love to add is the ability to add [Director cut] [extended] etc...
Any help would be appreciated.
Code: Select all
G:/Movies/{n.colon(' - ')} ({y})/{n.colon(' - ')} ({y}){' CD'+pi} - {vf} {
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"];
if(self.video[0].bitdepth != null && self.bitdepth >= 10 && self.video[0].colourprimaries != null && mHDRCol.get(self.video[0].colourprimaries) == "YES") 'HDR ' else '';
} {video[0].bitdepth.match('10') ? '[10bit]' : null} {vc} {
def best = any{audio.max{it.StreamSize.toInteger()}}{ audio.max{it.BitRate.replaceAll(/Unknown\s?\/\s?/).split(' / ')*.toInteger().max()}}{null};
def ChannelString = any{(best.'ChannelPositionsString2'.replaceAll(/Object\sBased\s\/|(\d+)?\sobjects\s\/|0.(?=\d.\d)/, '').split(' / ').collect{ it.split('/')*.toDouble().sum() }.max()).toString()}{null};
def audioCodec = (ac == 'MP3'||ac == 'AAC') ? ac : any{best.FormatProfile ? (best.Codec+'.'+best.FormatProfile.replaceAll(/\s?\/.*|E-AC-3\+|TrueHD|AC3|Matrix/)).replaceAll(/\.\+|\+\./, '+').replaceAll(/\.$/).replaceAll(/DTS\./, 'DTS-') : null}{best.Codec}{aco}{ac}{'ERROR'};
allOf{audioCodec}{any{ChannelString}{channels}}.join(' ');
}{subt}