Rename text if a tag is missing

All about user-defined episode / movie / file name format expressions
Post Reply
fedex03
Posts: 1
Joined: 22 Sep 2023, 13:35

Rename text if a tag is missing

Post by fedex03 »

Hi there,

I'm building my rename scheme and I get this:

Format: Select all

{ny} - {"[$vcf $vc $vf]"} {"[$aco $acf $af]"} [audio({audioLanguages.join(', ')}) sub({textLanguages.join(', ')})]{'.'+lang}
I wanted to specify the audio language and the subtitle (if they are embedded into the video).
Some video has not the subtitle embedded so I get a blank "sub()".

Is it possible to sky the sub part if they are missing?

Thank you in advace!
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename text if a tag is missing

Post by rednoah »

e.g. via String concatenation:

Format: Select all

{ 'sub(' + textLanguages.join(', ') + ')' }
e.g. via List.joining(delimiter, prefix, postfix) function:

Format: Select all

{ textLanguages.joining(', ', 'sub(', ')') }
:arrow: Learn how {expressions} work and useful Helper Functions
:idea: Please read the FAQ and How to Request Help.
Post Reply