Only output subtitle based on a metric

Support for Windows users
Post Reply
cagenuts
Posts: 17
Joined: 28 Nov 2021, 17:20

Only output subtitle based on a metric

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

Re: Only output subtitle based on a metric

Post 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)
:idea: Please read the FAQ and How to Request Help.
cagenuts
Posts: 17
Joined: 28 Nov 2021, 17:20

Re: Only output subtitle based on a metric

Post by cagenuts »

This is very good, thank you!

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

Much appreciated.
Post Reply