Conditional items in a panel container
#1
Hi,

When I select a set into the library (movie view), my view shows the posters for the movies that belong to it :
Image

All my sets are stored into dedicated folders, so, each folder corresponds to one set. However, when I select a folder into the video view, I've got this :
Image

I think extra default pictures are corresponding to nfo and jpeg files (one movie = 3 files, nfo, jpg and mkv) plus extra jpegs for folder (folder.jpg, fanart.jpg, poster.jpg).
I have tried to filter those extra files with conditional visibility for the itemlayout, this panel is for video view, not movie one :
Code:

<control type="panel" id="5000">
    <visible>ListItem.IsFolder + !ListItem.IsCollection</visible>
    <top>190</top>
    <left>15</left>
    <width>450</width>
    <bottom>70</bottom>
    <preloaditems>2</preloaditems>
    <autoscroll>true</autoscroll>
    <scrolltime tween="linear">1500</scrolltime>
    <orientation>vertical</orientation>
    <content sortorder="ascending">$INFO[ListItem.FolderPath]</content>
    <itemlayout height="201" width="150">
        <control type="group">
            <top>7</top>
            <visible>String.EndsWith(ListItem.FolderPath,.mkv)</visible>
            <control type="image">
                <top>0</top>
                <width>163</width>
                <height>211</height>
                <texture>DefaultActorSolid.png</texture>
                <aspectratio aligny="center">scale</aspectratio>
                <bordertexture border="21">overlays/shadow.png</bordertexture>
                <bordersize>13</bordersize>
            </control>
            <control type="image">
                <top>13</top>
                <left>13</left>
                <width>136</width>
                <height>185</height>
                <texture background="true">$INFO[ListItem.Art(poster)]</texture>
                <aspectratio aligny="center">scale</aspectratio>
            </control>
        </control>
    </itemlayout>
    <focusedlayout height="201" width="150">
        <control type="group">
            <left>0</left>
            <top>7</top>
            <visible>String.EndsWith(ListItem.FolderPath,.mkv)</visible>
            <control type="image">
                <top>0</top>
                <width>163</width>
                <height>211</height>
                <texture>DefaultActorSolid.png</texture>
                <aspectratio aligny="center">scale</aspectratio>
                <bordertexture border="21">overlays/shadow.png</bordertexture>
                <bordersize>13</bordersize>
            </control>
            <control type="image">
                <top>13</top>
                <left>13</left>
                <width>136</width>
                <height>185</height>
                <texture background="true">$INFO[ListItem.Art(poster)]</texture>
                <aspectratio aligny="center">scale</aspectratio>
            </control>
            <control type="image">
                <left>11</left>
                <top>11</top>
                <width>141</width>
                <height>190</height>
                <texture border="5" colordiffuse="button_focus">buttons/thumbnail_focused.png</texture>
            </control>
        </control>
    </focusedlayout>
</control>

But, then, I've got this, with empty spaces :
Image

How can I filter extra files to display correctly the set ? May be I should call a python script that filters nfo and jpeg files, however, I have no idea how to achieve this (I know how to call a script, but not how to send the folder path to it, nor how to send the result from it).

I've got an extra question : why autoscroll is not working for the code above ?

Thanks
Reply
#2
If you've scanned them to the library you should be able to use the movie view panel there as well.
Reply
#3
All my movies are added to the library. My goal is to get almost (I don't think I can have the set plot on the video view) the same display result whatever the way I watch my movies, library / movie view or by files with video view
Reply
#4
No one having any idea ?

At least why the autoscroll is not working ?
Reply
#5
If you want to eliminate the blanks then use a hidden list to get the folderpath contents then use static content in your panel which references the hidden list
e.g.: This should get you started:

xml:

<!-- Hidden List -->
<control type="list" id="5001">
<itemlayout width="1" height="1" />
<focusedlayout width="1" height="1" />
<visible>ListItem.IsFolder + !ListItem.IsCollection</visible>
<left>-10000</left>
<width>1</width>
<height>1</height>
<orientation>vertical</orientation>
<content sortorder="ascending">$INFO[ListItem.FolderPath]</content>
</control>

<!-- Panel Container -->
<control type="panel" id="5000">
<visible>Control.IsVisible(5001)</visible>
[** your panel definition **]
[** use ListItem.Property(poster) not Art() to reference poster **]
<content>
<item>
<label>$INFO[Container(5001).ListItemNoWrap(0).Label]</label>
<property name="poster">$INFO[Container(5001).ListItemNoWrap(0).Art(poster)]</property>
<visible>!String.IsEmpty(Container(5001).ListItemNoWrap(0).Art(poster))</visible>
<item>
<item>
<label>$INFO[Container(5001).ListItemNoWrap(1).Label]</label>
<property name="poster">$INFO[Container(5001).ListItemNoWrap(1).Art(poster)]</property>
<visible>!String.IsEmpty(Container(5001).ListItemNoWrap(1).Art(poster))</visible>
<item>
<item>
<label>$INFO[Container(5001).ListItemNoWrap(2).Label]</label>
<property name="poster">$INFO[Container(5001).ListItemNoWrap(2).Art(poster)]</property>
<visible>!String.IsEmpty(Container(5001).ListItemNoWrap(2).Art(poster))</visible>
<item>
<item>
<label>$INFO[Container(5001).ListItemNoWrap(3).Label]</label>
<property name="poster">$INFO[Container(5001).ListItemNoWrap(3).Art(poster)]</property>
<visible>!String.IsEmpty(Container(5001).ListItemNoWrap(3).Art(poster))</visible>
<item>
[** etc **]
</content>
</control>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#6
Thanks, I left the 5001 control as is (I have only add your code), and here is my other control :
Code:

<control type="panel" id="5000">
    <visible>Control.IsVisible(5001)</visible>
    <top>190</top>
    <left>1352</left>
    <width>450</width>
    <bottom>70</bottom>
    <preloaditems>2</preloaditems>
    <autoscroll>true</autoscroll>
    <scrolltime tween="linear">1500</scrolltime>
    <orientation>vertical</orientation>
    <content>
        <item>
            <label>$INFO[Container(5001).ListItemNoWrap(0).Label]</label>
            <property name="poster">$INFO[Container(5001).ListItemNoWrap(0).Art(poster)]</property>
            <visible>!String.IsEmpty(Container(5001).ListItemNoWrap(0).Art(poster))</visible>
        </item>
        <item>
            <label>$INFO[Container(5001).ListItemNoWrap(1).Label]</label>
            <property name="poster">$INFO[Container(5001).ListItemNoWrap(1).Art(poster)]</property>
            <visible>!String.IsEmpty(Container(5001).ListItemNoWrap(1).Art(poster))</visible>
        </item>
        <item>
            <label>$INFO[Container(5001).ListItemNoWrap(2).Label]</label>
            <property name="poster">$INFO[Container(5001).ListItemNoWrap(2).Art(poster)]</property>
            <visible>!String.IsEmpty(Container(5001).ListItemNoWrap(2).Art(poster))</visible>
        </item>
        <item>
            <label>$INFO[Container(5001).ListItemNoWrap(3).Label]</label>
            <property name="poster">$INFO[Container(5001).ListItemNoWrap(3).Art(poster)]</property>
            <visible>!String.IsEmpty(Container(5001).ListItemNoWrap(3).Art(poster))</visible>
        </item>
        <item>
            <label>$INFO[Container(5001).ListItemNoWrap(4).Label]</label>
            <property name="poster">$INFO[Container(5001).ListItemNoWrap(4).Art(poster)]</property>
            <visible>!String.IsEmpty(Container(5001).ListItemNoWrap(4).Art(poster))</visible>
        </item>
    </content>
    <itemlayout height="201" width="150">
        <control type="group">
            <top>7</top>
            <control type="image">
                <top>0</top>
                <width>163</width>
                <height>211</height>
                <texture>DefaultVideo.png</texture>
                <aspectratio aligny="center">scale</aspectratio>
                <bordertexture border="21">overlays/shadow.png</bordertexture>
                <bordersize>13</bordersize>
            </control>
            <control type="image">
                <top>13</top>
                <left>13</left>
                <width>136</width>
                <height>185</height>
                <texture background="true">$INFO[ListItem.Property(poster)]</texture>
                <aspectratio aligny="center">scale</aspectratio>
            </control>
        </control>
    </itemlayout>
    <focusedlayout height="201" width="150">
        <control type="group">
            <left>0</left>
            <top>7</top>
            <control type="image">
                <top>0</top>
                <width>163</width>
                <height>211</height>
                <texture>DefaultVideo.png</texture>
                <aspectratio aligny="center">scale</aspectratio>
                <bordertexture border="21">overlays/shadow.png</bordertexture>
                <bordersize>13</bordersize>
            </control>
            <control type="image">
                <top>13</top>
                <left>13</left>
                <width>136</width>
                <height>185</height>
                <texture background="true">$INFO[ListItem.Property(poster)]</texture>
                <aspectratio aligny="center">scale</aspectratio>
            </control>
            <control type="image">
                <left>11</left>
                <top>11</top>
                <width>141</width>
                <height>190</height>
                <texture border="5" colordiffuse="button_focus">buttons/thumbnail_focused.png</texture>
            </control>
        </control>
    </focusedlayout>
</control>

I have added only 5 items for testing. Unfortunally, only the first item is displayed, whatever how many items are in the list.

My other problem is that some sets have many items (e.g. James Bond, 26), may be I should limit the content (I was not gone for it Smile).

Last problem, the autoscroll is not working when the movie view is selected (the panel is slightly different from the one above, but mainly for the visibility condition).

If you have any suggestion Smile
Reply
#7
(2024-02-21, 11:30)CFou Wrote: I have added only 5 items for testing. Unfortunally, only the first item is displayed, whatever how many items are in the list.

You will need to add more than 5 items. If the first 4 items in the 5001 list do not have posters then you will only see one item (5).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
Oh, you are right, thanks a lot.

I will need to add a LOOOOOOT items Big Grin

any idea about the autoscroll which is not working ?
Reply
#9
(2024-02-21, 13:19)CFou Wrote: any idea about the autoscroll which is not working ?

What are you expecting autoscroll to do exactly? From your screenshots it doesn't look like there are enough items for autoscroll to be applicable as there is no next page of items to scroll to.

also I think you are missing a time="1000" attribute on the autoscroll tag to tell it how fast to scroll.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
About the number of items, I know that Wink but there are other sets Smile

about, the time attribute, I thought this would have worked
Code:

<scrolltime tween="linear">1500</scrolltime>

It seems I was wrong, I will check, I cannot test it right now, I'll let you know.

Thanks
Reply
#11
I have set this :
Code:

<autoscroll delay="1000" time="3000">true</autoscroll>
and
Code:

<autoscroll delay="1000" time="3000">true</autoscroll>
<scrolltime tween="linear">1500</scrolltime>

Unfortunally, none are working, 26 items for the tested set, only the first 6 or 12 (depending on the view) are displayed without any autoscroll.
Reply
#12
I have done some testing, by simply changing type="panel" by type="list" then type="warplist" and then even type="fixedlist", autoscroll for all other containers is working. Each one is auto focusing the first item, then the second one, and then start scrolling for the third item.

When I set type="panel", no item is focused by default. When I put my mouse over an item (without clicking), it get the focusedlayout, but no scrolling even if I don't move the mouse. When I move the mouse out of the list, then no item is focused again.

Bug ?
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional items in a panel container0