Req How to use <visible> to show and hide the contents of a label
#1
Video 
How is it possible to use <visible> to show/not show the contents of a label, based on the flag: watched/not watched?

EXAMPLE:
<visible>!Control.IsVisible(50) + !Control.HasFocus(499) + [true | System.GetBool(videolibrary.showunwatchedplots)]</visible>

But in my skin (confluence) this doesn't work.
I need a more immediate and simple command based on the flag watched/not watched.

Image

Thanks to those who will help me...
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#2
(2022-08-08, 19:03)alberto1998 Wrote: How is it possible to use <visible> to show/not show the contents of a label, based on the flag: watched/not watched?

EXAMPLE:
<visible>!Control.IsVisible(50) + !Control.HasFocus(499) + [true | System.GetBool(videolibrary.showunwatchedplots)]</visible>

But in my skin (confluence) this doesn't work.
I need a more immediate and simple command based on the flag watched/not watched.

Image

Thanks to those who will help me...

hm. some

for the whole container, i think it should be
System.Setting(hidewatched)    Returns true if 'hide watched items' is selected.


For list items there are a few, depending on use case, you can create some mix.
some examples

txt:
some common bools
[Integer.IsGreater(ListItem.PlayCount,0) + !ListItem.IsResumable]

based on (core) image detection
String.IsEqual(ListItem.Overlay,OverlayWatched.png)
String.IsEqual(ListItem.Overlay,OverlayUnWatched.png)

new in nexus (for tv show/season items)
String.IsEqual(ListItem.Property(WatchedEpisodePercent),100)

pvr ( may not that correct in terms of watched state, but has some other benefits)
ListItem.HasEpg + String.IsEqual(ListItem.Progress, *maybe 100 ? idk*)
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#3
@mardukL

I think I have not quite understood how to use it.

I need it to hide the title of the TV episodes not yet seen, (to avoid spoilers).

So i use it with skin confluence, in the library section of kodi> tv shows
(The "hide already seen" indicator is disabled and I don't use it)


In this piece of code:

<include name="MediaListView4">
...
<control type="label">
                    <left>10</left>
                    <top>395</top>
                    <width>400</width>
                    <height>30</height>
                    <font>font24_title</font>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                    <align>left</align>
                    <aligny>center</aligny>
                    <label>$INFO[ListItem.Label]</label>
                    <visible>!Control.IsVisible(50) + !Control.HasFocus(499) + [true | System.Setting(hidewatched)]</visible>   (?)
                </control>

How can i use the item you provided me with?


Thanks for your help
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#4
(2022-08-08, 20:15)alberto1998 Wrote: @mardukL

I think I have not quite understood how to use it.

I need it to hide the title of the TV episodes not yet seen, (to avoid spoilers).

So i use it with skin confluence, in the library section of kodi> tv shows
(The "hide already seen" indicator is disabled and I don't use it)


In this piece of code:

<include name="MediaListView4">
...
<control type="label">
                    <left>10</left>
                    <top>395</top>
                    <width>400</width>
                    <height>30</height>
                    <font>font24_title</font>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                    <align>left</align>
                    <aligny>center</aligny>
                    <label>$INFO[ListItem.Label]</label>
                    <visible>!Control.IsVisible(50) + !Control.HasFocus(499) + [true | System.Setting(hidewatched)]</visible>   (?)
                </control>

How can i use the item you provided me with?


Thanks for your help


some examples - choose one , and test (may wished use case is covered)
    a) no title based on watchedoverlay icon
    <value condition="[container.content(episodes) | string.isequal(listitem,episode)] + String.IsEqual(ListItem.Overlay,OverlayUnWatched.png)">$INFO[ListItem.Season,s:,]$INFO[ListItem.Episode, | e:,]</value>
    
    b) no title if either NEVER watched - just good if you wanna rely just on playcount
    <value condition="[container.content(episodes) | string.isequal(listitem.dbtype,episode)] + Integer.IsEqual(ListItem.PlayCount,0)">$INFO[ListItem.Season,s:,]$INFO[ListItem.Episode, | e:,]</value>
    
    c)    based just on progress is maybe to viable thing you looking for, watched less than 10 percent
    <value condition="[container.content(episodes) | string.isequal(listitem.dbtype,episode)] + Integer.IsLess(ListItem.Progress,10)">$INFO[ListItem.Season,s:,]$INFO[ListItem.Episode, | e:,]</value>
    
    d) based on global kodi setting setting "dont show plot " for unwatched item - listitem.plot will return the 
        localized string id msgctxt "#20370" than which is msgid "* Hidden to prevent spoilers *"
    <value condition="[container.content(episodes) | string.isequal(listitem.dbtype,episode)] + String.IsEqual(ListItem.Plot, $LOCALICE[20370])">$INFO[ListItem.Season,s:,]$INFO[ListItem.Episode, | e:,]</value>

xml:

<control type="label">
    <left>10</left>
    <top>395</top>
    <width>400</width>
    <height>30</height>
    <font>font24_title</font>
    <textcolor>white</textcolor>
    <shadowcolor>black</shadowcolor>
    <align>left</align>
    <aligny>center</aligny>
    <label>$VAR[i_try_explain_via_variable]</label>
    <visible>!Control.IsVisible(50) + !Control.HasFocus(499)</visible>
</control>

<variable name="i_try_explain_via_variable">
    <value condition="[container.content(episodes) | string.isequal(listitem.dbtype,episode)] + String.IsEqual(ListItem.Plot, $LOCALICE[20370])">$INFO[ListItem.Season,s:,]$INFO[ListItem.Episode, | e:,] or whatever should be used</value>
    <value>$INFO[ListItem.Label]</value>
</variable>
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#5
@mardukL

Thanks for the code provided, I believe we are close to the solution.

I believe it is option A.
I've tried, even changing the code, but can't get what I need.
I made this picture scheme to make you understand better, I think I don't need all that code you provided me, I think the option is simpler.

Forgive me, and thank you for all the help you are giving me. 🙏

There are 3 photos in sequence, to try to explain myself better. see all 3 pictures...
I hope I have explained myself better.
Image

How can i get the view as the first and second picture merged?
(without going through to comment on the code and then not seeing any title even for the episodes already seen)
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#6
I think @mardukL gave you the correct answer already. Use the Boolean expression String.IsEqual(ListItem.Overlay,OverlayWatched.png). That will be true whenever an item has been watched. Plot visibility for unseen items is controlled in the system settings.

xml:

<visible>!Control.IsVisible(50) + !Control.HasFocus(499) + String.IsEqual(ListItem.Overlay,OverlayWatched.png)</visible>
Reply
#7
@QuizKid It works perfectly!!!
It is exactly this line of code that I needed. (I couldn't quite understand how to insert the various parameters between them).

Thank you very much @QuizKid 

Yes, @mardukL gave me many options, I was interested in option A, but I haven't been so good at knowing how to use it correctly. (I think also because something similar was already inserted in the code, but in a different form with a different result). @mardukL , I really thank him for all the options He has provided me, and for his time that he has devoted to me to be able to arrive at the solution. 🙏
I believe that the options he has given me can also be useful for many other users and I thank him for that.


Thank you both, this thread can be closed...
If i helped you, you can thank me with a thumbs up 👍 below, thanks 🙏.
Kodi 20.x stable release | Skin Confluence (by Jezz_X)
I like editing skins ❤
Reply
#8
@"alberto1998" glad you got it working!
Reply
#9
@"alberto1998" also glad you figured it out.
( may my thinking about options is a bit complicated sometimes )
Skins |  Titan M O D   •   S W A N (WIP)
Reply

Logout Mark Read Team Forum Stats Members Help
How to use <visible> to show and hide the contents of a label0