jurialmunkey / script.skinvariables

A helper script for Kodi skinners to construct multiple variables
GNU General Public License v3.0
37 stars 16 forks source link

[BUG] Empty values incorrectly handled. #20

Closed roidy closed 1 year ago

roidy commented 1 year ago

My template:-

<variable name="SeasonValue" containers="9101...9130">
    <value condition="!String.IsEmpty(Container({id}).ListItem.Property(stacked_count))"></value>
    <value condition="!String.IsEmpty(Container({id}).ListItem.Property(episodes_added))"></value>
    <value condition="String.IsEqual(Container({id}).ListItem.Property(Param.Info),library_airingnext)"></value>
    <value condition="String.IsEqual(Container({id}).ListItem.Property(Param.Info),trakt_anticipated)"></value>
    <value condition="String.IsEqual(Container({id}).ListItem.Property(Param.Info),trakt_watchlist)"></value>

    <value condition="String.IsEqual(Container({id}).ListItem.DBType,tvshow) + Integer.IsEqual(Container({id}).ListItem.Season,1)">1 Season  ·   </value>
    <value condition="String.IsEqual(Container({id}).ListItem.DBType,tvshow)">$INFO[Container({id}).ListItem.Season,, Seasons  ·  ]</value>

    <value condition="String.IsEqual(Container({id}).ListItem.DBType,episode) + Integer.IsEqual(Container({id}).ListItem.Season,0)">$LOCALIZE[20381], </value>
    <value condition="String.IsEqual(Container({id}).ListItem.DBType,episode) + Integer.IsEqual(Container({id}).ListItem.Season,1)">Season 1, </value>
    <value condition="String.IsEqual(Container({id}).ListItem.DBType,episode)">$INFO[Container({id}).ListItem.Season,Season ,$COMMA ]</value>
</variable>

The first 5 empty values are there to force an early return with an empty value, however skinvariables won't evaluate any value that returns nothing.

jurialmunkey commented 1 year ago

Hmmm weird... Not sure why I stopped those from building. Above commit (v1.0.8) should fix it (working in my tests)

roidy commented 1 year ago

Works great, thanks 👍