Indicate non-HDR with "SDR"

Support for macOS users
Post Reply
yhm28
Posts: 27
Joined: 24 Jan 2018, 07:20

Indicate non-HDR with "SDR"

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

Re: Indicate non-HDR with "SDR"

Post 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(' ', ' - [', ']')
}
:idea: Please read the FAQ and How to Request Help.
yhm28
Posts: 27
Joined: 24 Jan 2018, 07:20

Re: Indicate non-HDR with "SDR"

Post by yhm28 »

perfect, thanks!
Post Reply