Page 1 of 1

Indicate non-HDR with "SDR"

Posted: 07 Oct 2024, 08:43
by yhm28
Non-HDR content shows an undefined value or blank space

Here is the format I want to update with an HDR tag at the end before the close bracket ]

Format: Select all

{n} - {s00e00} - {t} - [{airdate} {vf} {mbps} {aco.replace('DTS-HD Master Audio','DTS-HD').replace ('Dolby TrueHD with Dolby Atmos','TrueHD')} {af} {video[0].FrameRate} {vc.replace('Microsoft','VC-1').replace('AVC','H.264').replace('HEVC','H.265')} {hdr.replace('Dolby Vision','DoVi')}]
The problem is that an SDR file will have a (blank) space before the close bracket ] ie. "H.265 ]" instead of "H.265]"

1. What would I need to add to this so that non-HDR files are labeled "SDR"?

2. Alternatively, what would I need to add if I wanted non-HDR files to simply have no tag? to end with {vc} and no space before the ]

Re: Indicate non-HDR with "SDR"

Posted: 07 Oct 2024, 17:51
by rednoah
You can account for undefined values like so:

Format: Select all

{ any{ hdr }{ 'SDR' } }

Format: Select all

{ allOf{ vc }{ ac }{ hdr }{ source }{ group } }
:idea: Learn how {expressions} work and useful Helper Functions › Helper Functions




:arrow: You'll want to rewrite your format like so:

Format: Select all

{n} - {s00e00} - {t}
{ allOf
  { airdate }
  { vf }
  { mbps }
  { aco.replace('DTS-HD Master Audio':'DTS-HD', 'Dolby TrueHD with Dolby Atmos':'TrueHD') }
  { af }
  { video[0].FrameRate }
  { vc.replace('Microsoft':'VC-1', 'AVC':'H.264', 'HEVC':'H.265') }
  { any{ hdr.replace('Dolby Vision':'DoVi') }{ 'SDR' } }
  .joining(' ', ' - [', ']')
}

Re: Indicate non-HDR with "SDR"

Posted: 08 Oct 2024, 08:12
by yhm28
perfect, thanks!