I am trying to rename my videos with language information, or show the audio streams count when no language info is available. This is imposible, hasPropertiy() is broken as this example shows:
{ (audio.hasProperty("language")) ? "YES" : "NO " + audio.language }
if defined (ie: language=ru), it prints: "NO ru"
if not defined, it prints nothing (throws an exception trying to get audio.language)
That is, in both cases audio.hasProperty("language") is FALSE, regardless of .language being defined or not.
Is this a bug where?
Tested both, 4.5 and 4.5.2 with
openjdk version "1.8.0_40"
OpenJDK Runtime Environment (build 1.8.0_40-b10)
OpenJDK 64-Bit Server VM (build 25.40-b14, mixed mode)
hasProperty() is always FALSE
Re: hasProperty() is always FALSE
audio does not implement hasProperty. It's not a "normal" map/object since everything is only lazy evaluated, so "properties" only exist on access.
This is how I'd write a conditional format:
This is how I'd write a conditional format:
Code: Select all
{ any{'Language is '+audio.language}{'No Language'} }
Re: hasProperty() is always FALSE
Not being my field, I thought for hours about a workaround, nothing I tried worked. You made my day, thanks!
{n} - {s00e00.lower()} - {t} [{vf}.{vc}.{ac}.{ any{af+'('+audios.language.join(" ")+")"}{(audios.size()>1) ? audios.size()+"x"+af : af}}{any{'.Sub('+texts.language.join(".")+")"}{(texts.size()>0) ? '.'+texts.size()+"xSub":""}{""}}]{"."+lang}
Which translates for video to ie:
The Walking Dead - s05e01 - No Sanctuary [720p.HEVC.AAC.2ch(en).Sub(en.fr)]
The Walking Dead - s05e02 - The title here [720p.HEVC.AAC.2ch(en).2xSub)]
And for aditional external subtitles to:
The Walking Dead - s05e02 - The title here [720p.HEVC.AAC.2ch(en).2xSub)].rus
{n} - {s00e00.lower()} - {t} [{vf}.{vc}.{ac}.{ any{af+'('+audios.language.join(" ")+")"}{(audios.size()>1) ? audios.size()+"x"+af : af}}{any{'.Sub('+texts.language.join(".")+")"}{(texts.size()>0) ? '.'+texts.size()+"xSub":""}{""}}]{"."+lang}
Which translates for video to ie:
The Walking Dead - s05e01 - No Sanctuary [720p.HEVC.AAC.2ch(en).Sub(en.fr)]
The Walking Dead - s05e02 - The title here [720p.HEVC.AAC.2ch(en).2xSub)]
And for aditional external subtitles to:
The Walking Dead - s05e02 - The title here [720p.HEVC.AAC.2ch(en).2xSub)].rus