v18 Q/BUG?: Variable is failing, but visible conditions working (listitem.rating)
#1
hi, i got issues with variables on listitem.rating(*foo*) conditions OUTSIDE OF dialogvideoinfo.xml.
        
        I tried to save some code using variables in a viewtype, but it fails and i get incorrect results, where the multiple control types are working as expected.
        

        I am using panel container in  myvideonav.xml
        
        -  default scraped rating is fetched from tmdb, so listitem.rating is equal listitem.rating(themoviedb) for movies , listitem.rating(tvdb) for shows/episodes [ratings also stored in nfo !]
        
        - if i use multiple controls with visible conditions everything seems working as expected, EVEN THE COLORS
        but if i want to save some code lines using a variable i got strange behaviour.
        
        
        If i using variable for (text)color i get ( inconsitent?) issues JUST FOR COLORS !
        
        After some testing , i made a "fool check" in the variable(s) if $INFO[Listitem.rating(*foo*)] is the issue, as it was'nt supposed to work outside of dialogvideoinfo.xml and therefore fall back to the default scraped rating value.
        
        BUT IT CAN BE USED AS CONDITION AND LABEL !!
        
        ->>    image and labels working as expected, just colors get strange behaviour
        
WEIRD VIDEO to show as proof
        
        - IMAGE
            - working as expected
        - LABEL
            - working as expected
            
        - COLORS
            (tvdb green[FF388E3C], themoviedb cyan[FF00FFFF] , scraped yellow[FFFFFF00] , empty red, foolcheck magenta[FFFF00FF] )
        
            => moviesets
                - onfocus CYAN, unfocused YELLOW using variable
                - onfocus YELLOW, unfocused YELLOW using multiple groups/vis conditions
            
            => parent/no media item
                - onfocus red, unfocused yellow using variable
                - onfocus red, unfocused red using multiple groups/vis conditions
                
            => movie/tvshow random using nfo
                - onfocus red, unfocused cyan using variable (nachts im museum, ??)
                - onfocus yellow, unfocused cyan using variable (zeit des erwachens,inside lewin davis ??)
                    
                    -> wrong onfocus color depends on previous fetch fail Huh
                    -> unfocused item color flicker on an item change even if its not the item which gains focus ( unfocused item chekcs variable again )
                    e.g. folder is empty = RED - next failing random movie will get red, until reload skin, or scroll item out of visibility and back, which than result in YELLOW

                    
                - onfocus cyan, unfocused cyan using multiple groups/vis conditions
                
                
xml:

                <control type="group">
                    <visible>Control.IsVisible(502)</visible>
                            
                    <control type="panel" id="502">
                        <orientation>vertical</orientation>
                        <preloaditems>4</preloaditems>
                        <scrolltime tween="quadratic">400</scrolltime>
                        <left>150</left>
                        
                        <include>MediaOffsetValues</include>
                        <include>Oninfo_MovieSetInfo</include>
                        <include>NavControl_Media</include>
                        
                        <viewtype label="infocards">infocards</viewtype>
                        
                        <itemlayout height="420" width="800">
                            
                            <include content="template501">
                                <param name="is_focused" value="false" />
                            </include>
                        </itemlayout>
                    
                        <focusedlayout height="420" width="800">
                            <include content="template501">
                                <include>SetPropOnFocus_HiddenButton</include>
                            </include>
                        </focusedlayout>
                    </control>
                    
                    
                    
                </control>
                
                
                ....
                <include name="template501">
                    <param name="is_focused" default="true" />
            
                        <definition>
                        
                        
                            <control type="group">
                                <nested />
                                <width>790</width>
                                <height>400</height>
                                
                                <control type="image">
                                    <description>focus frame</description>
                                    <texture colordiffuse="white">colors/white.png</texture>
                                    <top>0</top>
                                    <aspectratio scalediffuse="true" aligny="top">scale</aspectratio>
                                    <visible>$PARAM[is_focused]</visible>
                                </control>
                                <control type="image">
                                    <description>tile bg</description>
                                    <texture colordiffuse="$PARAM[color]">colors/white.png</texture>
                                    <top>0</top>
                                    <bordersize>5</bordersize>
                                    <aspectratio scalediffuse="true" aligny="top">scale</aspectratio>
                                </control>
                                <control type="image">
                                    <description>diffused fanart</description>
                                    <top>10</top>
                                    <left>10</left>
                                    <width>490</width>
                                    <height>289</height>
                                    <texture background="true" diffuse="diffuse/Spotlight_right_diffuse.png">$VAR[ImageLayout_fanart]</texture>
                                    <aspectratio scalediffuse="true" align="left" aligny="top">scale</aspectratio>
                                </control>
                                <control type="image">
                                    <description>clear logo</description>
                                    <visible>
                                     [
                                      !String.IsEmpty(ListItem.Art(tvshow.clearlogo)) |
                                      !String.IsEmpty(ListItem.Art(artist.clearlogo)) |
                                      !String.IsEmpty(ListItem.Art(albumartist.clearlogo)) |
                                      !String.IsEmpty(ListItem.Art(clearlogo))
                                     ]
                                    </visible>
                                    <top>0</top>
                                    <right>20</right>
                                    <width>250</width>
                                    <height>120</height>
                                    <texture background="true" diffuse="colors/white80.png">$VAR[ListItemClearLogo]</texture>
                                    <aspectratio scalediffuse="true" aligny="center">keep</aspectratio>
                                </control>
                                <control type="textbox">
                                    <description>clear logo fallback, need title var , e.g. if season show show title</description>
                                    <visible>
                                     [
                                     String.IsEmpty(ListItem.Art(clearlogo)) +
                                     String.IsEmpty(ListItem.Art(tvshow.clearlogo)) +
                                     String.IsEmpty(ListItem.Art(artist.clearlogo)) +
                                     String.IsEmpty(ListItem.Art(albumartist.clearlogo))
                                     ]
                                    </visible>
                                    <top>0</top>
                                    <right>20</right>
                                    <width>250</width>
                                    <height>135</height>
                                    <info>listitem.title</info>
                                    <font>debug</font>
                                    <textcolor>white</textcolor>
                                    <align>center</align>
                                </control>
                                
                                <control type="group">
                                
                                    <description>V A R I A B L E   usage</description>
                                    
                                    <control type="image">
                                        <bottom>15</bottom>
                                        <right>60</right>
                                        <width>100</width>
                                        <height>25</height>
                                        <texture>$VAR[502_ratingimage]</texture>
                                        <aspectratio align="right">keep</aspectratio>
                                    </control>
                                    <control type="textbox">
                                        <bottom>15</bottom>
                                        <right>20</right>
                                        <width>50</width>
                                        <height>25</height>
                                        <label>$VAR[502_ratinglabel]</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>$VAR[502_ratingcolor]</textcolor>
                                    </control>
                                    <control type="textbox">
                                        <bottom>15</bottom>
                                        <right>130</right>
                                        <width>300</width>
                                        <height>25</height>
                                        <label>this is using VARIABLE</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>ffffffff</textcolor>
                                    </control>
                                </control>
                                
                                <control type="group">
                                    
                                    <description>V I S I B L E    C O N D I T I O N usage</description>
                                    
                                    <control type="image">
                                        <description>tvdb</description>
                                        <visible>!String.IsEmpty(ListItem.Rating(tvdb))</visible>
                                        <bottom>60</bottom>
                                        <right>60</right>
                                        <width>100</width>
                                        <height>25</height>
                                        <texture>flags/ratings/tvdb_color.png</texture>
                                        <aspectratio align="right">keep</aspectratio>
                                    </control>
                                    <control type="image">
                                        <description>themoviedb</description>
                                        <visible>!String.IsEmpty(ListItem.Rating(themoviedb))</visible>
                                        <bottom>60</bottom>
                                        <right>60</right>
                                        <width>100</width>
                                        <height>25</height>
                                        <texture>flags/ratings/themoviedb_color.png</texture>
                                        <aspectratio align="right">keep</aspectratio>
                                    </control>
                                    <control type="image">
                                        <visible>!String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]</visible>
                                        <bottom>60</bottom>
                                        <right>60</right>
                                        <width>100</width>
                                        <height>25</height>
                                        <texture>defaultaddonhelper.png</texture>
                                        <aspectratio align="right">keep</aspectratio>
                                    </control>
                                    <control type="textbox">
                                        <visible>!String.IsEmpty(ListItem.Rating(tvdb))</visible>
                                        <bottom>60</bottom>
                                        <right>20</right>
                                        <width>50</width>
                                        <height>25</height>
                                        <label>$INFO[ListItem.Rating(tvdb)]</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>FF388E3C</textcolor>
                                    </control>
                                    <control type="textbox">
                                        <visible>!String.IsEmpty(ListItem.Rating(themoviedb))</visible>
                                        <bottom>60</bottom>
                                        <right>20</right>
                                        <width>50</width>
                                        <height>25</height>
                                        <label>$INFO[ListItem.Rating(themoviedb)]</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>FF00FFFF</textcolor>
                                    </control>
                                    <control type="textbox">
                                        <visible>!String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]</visible>
                                        <bottom>60</bottom>
                                        <right>20</right>
                                        <width>50</width>
                                        <height>25</height>
                                        <label>$INFO[ListItem.Rating]</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>FFFFFF00</textcolor>
                                    </control>
                                    <control type="textbox">
                                        <visible>String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]</visible>
                                        <bottom>60</bottom>
                                        <right>20</right>
                                        <width>50</width>
                                        <height>25</height>
                                        <label>empty</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>FFCE4421</textcolor>
                                    </control>
                                    <control type="textbox">
                                        <bottom>60</bottom>
                                        <right>130</right>
                                        <width>350</width>
                                        <height>25</height>
                                        <label>this is using VISIBLE CONDITIONS</label>
                                        <font>debugtiny</font>
                                        <align>right</align>
                                        <textcolor>ffffffff</textcolor>
                                    </control>
                                </control>
                                
                                
                                
                                
                                </control>
                                
                                
                                
                                
                            
                        </definition>
                    </include>
        
        
        
        THE VARIABLES
        
        
xml:

        <variable name="502_ratingimage">
            <value condition="!String.IsEmpty(ListItem.Rating(checkiffallbacktodefaultrating))">defaultrecentlyaddedepisodes.png</value>
            <value condition="!String.IsEmpty(ListItem.Rating(tvdb))">flags/ratings/tvdb_color.png</value>
            <value condition="!String.IsEmpty(ListItem.Rating(themoviedb))">flags/ratings/themoviedb_color.png</value>
            <value condition="!String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]">defaultaddonhelper.png</value>
            <value></value>
        </variable>
        
        <variable name="502_ratingcolor">
            <value condition="!String.IsEmpty(ListItem.Rating(checkiffallbacktodefaultrating))">FFFF00FF</value>
            <value condition="!String.IsEmpty(ListItem.Rating(tvdb))">FF388E3C</value>
            <value condition="!String.IsEmpty(ListItem.Rating(themoviedb))">FF00FFFF</value>
            <value condition="!String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]">FFFFFF00</value>
            <value>FFCE4421</value>
        </variable>
        
        <variable name="502_ratinglabel">
            <value condition="!String.IsEmpty(ListItem.Rating(checkiffallbacktodefaultrating))">666</value>
            <value condition="!String.IsEmpty(ListItem.Rating(tvdb))">$INFO[ListItem.Rating(tvdb)]</value>
            <value condition="!String.IsEmpty(ListItem.Rating(themoviedb))">$INFO[ListItem.Rating(themoviedb)]</value>
            <value condition="!String.IsEmpty(ListItem.Rating) + [String.IsEmpty(ListItem.Rating(themoviedb)) + String.IsEmpty(ListItem.Rating(tvdb))]">$INFO[listitem.rating]</value>
            <value>empty</value>
        </variable>
        
        

ANY HINTS, TIPPS are welcome. Even my hopes ListItemRating[*foo*] are supported shrinks.
Reply

Logout Mark Read Team Forum Stats Members Help
Q/BUG?: Variable is failing, but visible conditions working (listitem.rating)0