Kodi Community Forum

Full Version: Basic conditional for TV Shows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm wondering what's the standard way for having a DialogVideoInfo that adjusts to whether the container is a Movie or a TV Show. I'm thinking it'd be something along the lines of having two major groups within the file, one with a <visible></visible> that appears if it's a movie, and one that appears if it's a TV episode. I don't know how to refer to that though.

I'm also interested on a conditional that appears only if the container doesn't have a plot.
(2018-08-13, 17:42)firewater Wrote: [ -> ]I'm wondering what's the standard way for having a DialogVideoInfo that adjusts to whether the container is a Movie or a TV Show .... one with a <visible></visible> that appears if it's a movie, and one that appears if it's a TV episode. I don't know how to refer to that though.
 <visible>Container.Content(TVShows)</visible>

EDIT: Or use dbtypes "String.IsEqual(ListItem.DBType,xx)" -> u can thake a look here to decide whats better.
 
(2018-08-13, 17:42)firewater Wrote: [ -> ]I'm also interested on a conditional that appears only if the container doesn't have a plot.
<visible>String.IsEmpty(ListItem.plot)</visible>
Hmm, so my case is that I display a fanart for movies, but when I load up and episode I want the thumbnail to show up instead. I tried with the following:

xml:
                <control type="image">
                    <right>0</right>
                    <width>1920</width>
                    <height>1080</height>
                    <aspectratio>scale</aspectratio>
                    <texture>$INFO[ListItem.Art(thumb)]</texture>
                    <visible>!Container.Content(TVShows)</visible>
                </control>
                <control type="image">
                    <right>0</right>
                    <width>1920</width>
                    <height>1080</height>
                    <aspectratio>scale</aspectratio>
                    <texture>$INFO[ListItem.Art(fanart)]</texture>
                    <visible>!Container.Content(Movie)</visible>
                </control>

But it shows fanart in both cases. I added an exclamation mark because I saw it in some other code, and if I remove it, it doesn't display either image at all.
The ! negates the condition so it ends up meaning 'container does not contain tv shows'.

Also you want to use Container.Content(Episodes) for episodes.
Oh I understand now. Thanks guys!