Page 1 of 1

Only output subtitle based on a metric

Posted: 01 Nov 2023, 15:39
by cagenuts
You helped me before on this.

This is part of a GUI preset

Code: Select all

{if (textLanguages)".${text.collect{ it.Title ? "${it.'Language/String3'} ($it.Title)" : it.'Language/String3' } }"}
Which produces this.

Code: Select all

[eng, eng (HI), eng (HI-C)]
Two questions if I may.

1. Is it possible to change the comma to a period? So it looks like this?

Code: Select all

[eng. eng (HI). eng (HI-C)]
and then
2. Is it possible to only include the subtitle to the extreme right? Or put another way, based on a metric of sorts. If A exists then output A, if A & B exist output only B, if A & B & C exist output only C.

So if there are only normal subtitles it will look like this.

Code: Select all

[eng]
But if only normal and Hearing Impaired subs are available it will look like this

Code: Select all

[eng (HI)]
And lastly if normal, hearing impaired AND hearing impaired with colours are available, it will look like this.

Code: Select all

[eng (HI-C)]
mediainfo https://pastebin.com/2u2XDCPE

5 minute video extract and GUI preset
https://mega.nz/folder/6QBEyDLQ#Hgg6WhekGBu1-pAhZq_6Rg

Just trying to make the filename a bit shorter.

Re: Only output subtitle based on a metric

Posted: 01 Nov 2023, 17:37
by rednoah
e.g.

Format: Select all

{ n.replaceAll(/[:|]/, "ː") }
{ '.' + s00e00 }
{ '.' + t.replaceAll(/[:|]/, "ː") }
{ '.' + vs.upper() }
{ '.' + hd }
{ '.' + vcf }
{ '.' + aco }
{ '.' + audio[1].Title }
{ '.' + text.last().'Language/String3' + (text.last().'Title' ? ' (' + text.last().'Title' + ')' : '') }

Code: Select all

Richard Osman's House of Games.S07E26.Week 6ː Monday.SD.AVC.AAC.eng (HI-C)

Re: Only output subtitle based on a metric

Posted: 02 Nov 2023, 06:31
by cagenuts
This is very good, thank you!

I will update this thread if I pick up any funnies.

Much appreciated.