How to check if Smartplaylist got Files? (visible for Menuitem)
#1
Hello

is there a Way to check if a Smartplaylist got Files/Content to set the Visible according to this?

PHP Code:
<item id="21">
    <
description>Documentary</description>
    <
label>31961</label>
    <
icon>special://skin/backgrounds/documentary.jpg</icon>
    
<thumb>$INFO[Skin.String(Home_Custom_Back_Docu_Folder)]</thumb>
    <
onclick>XBMC.ActivateWindow(10025,special://skin/playlists/Documentarys/Dokus.xsp,return)</onclick>
    
<visible>!Skin.HasSetting(HomeMenuNoDocuButton) + ???</visible>
</
item

would like to show the Menuitem just if "special://skin/playlists/Documentarys/Dokus.xsp" got Files in it, acording to "Container.Content(movies)"

Think about a Stringcompare or something. But at the Moment no clue what could do the job.

Regards.

--------------
EDIT:
O.K. Propably i miss something Simple & Stupid?

i try it with "Library.HasContent(special://skin/playlists/Documentarys/Dokus.xsp)" as i do it in the Widget
and i try it with "!IsEmpty(special://skin/playlists/Documentarys/Dokus.xsp)"

both with no Luck. (Item wont show up!)

Did think about a Syntax mistake and did try also
PHP Code:
<visible>!Skin.HasSetting(HomeMenuNoDocuButton) + Library.HasContent(playlist=special://skin/playlists/Documentarys/Dokus.xsp)</visible> 

no clue

EDIT2:

Just beacause i feel Funny i try also:

PHP Code:
StringCompare(playlist=special://skin/playlists/Documentarys/Dokus.xsp.NumItems,IntegerGreatherThan(NumItems,0) 

lol. but as you shurely guess - No Luck.
Reply
#2
If you use gotham you could achieve this with a workaround. Load the playlist in a dummy list id="xxx" with
Code:
<content>special://skin/playlists/Documentarys/Dokus.xsp</content>
and then use visible condition IntegerGreatherThan(Container(xxx).NumItems,0) in item id 21. As far as I know there's no other way of knowing if that playlist has items on the home screen.
Reply
#3
Yes that's the only way but beware that depending on the size of the playlist and performance of the system there could be a delay of a couple of seconds.
Image
Reply
#4
(2014-02-04, 19:34)BigNoid Wrote: If you use gotham you could achieve this with a workaround. Load the playlist in a dummy list id="xxx" with
Code:
<content>special://skin/playlists/Documentarys/Dokus.xsp</content>

Thanks for your replay

Did try to follow your suggestion. But got some Problems while trying to generate a "dummy list" couldn't figuere out how this should look like, and where to place.

my attempts:

PHP Code:
1.try
        <
control>
            <
description>DummyList</description>
            <
type>listcontrol</type>
            <
id>123</id>
            <
content>special://skin/playlists/Documentarys/Dokus.xsp</content>
        
<control>
        
        
2.try
        <
control type="list" id="123">
            <
description>DummyList</description>
            <
content>special://skin/playlists/Documentarys/Dokus.xsp</content>
        
<control>
        
        
3.try
        <
control type="list"id="123">
            <
description>DummyList</description>
            <
visible>true</visible>
            <
viewtype>list</viewtype>
            <
itemlayout width="250" height="29">
            </
itemlayout>
            <
focusedlayout height="29" width="250">
            </
focusedlayout>
            <
content>special://skin/playlists/Documentarys/Dokus.xsp</content>
        
<control
get allways a Blackscreen as soon as i try to reload the skin.


EDIT:

Got it!
PHP Code:
!IsEmpty(Window(Home).Property(PlaylistLastMovieMenu3.1.Title)) 

Propaby i was just thinking to complicated.
With this solution i have to Quit XBMC and restart as soon as i removed my Documentarys from the DB but as it looks now it works fine.
Reply
#5
Try this:

Code:
            <control type="list" id="123">
                <posx>-100</posx>
                <posy>-100</posy>
                <width>100</width>
                <height>100</height>
                <itemlayout height="100" width="100"/>
                <focusedlayout height="100" width="100"/>
                <content>special://skin/playlists/Documentarys/Dokus.xsp</content>
            </control>
Reply
#6
Thanks.

Will give it a try.
With the other solution (Edit aboth) it works also, all i have to do, is set the onload of the RA Script the right way.
(No Idea why i not earlyr think about this?? confused)

Thanks.
Reply
#7
Right, that should work too Smile
Reply

Logout Mark Read Team Forum Stats Members Help
How to check if Smartplaylist got Files? (visible for Menuitem)0