Kodi Community Forum

Full Version: Number of movies in a collection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Feature request:

If a listitem is a collection, then it would be cool, to have an infolabel for the number of movies inside the collection, to use that info inside a item/focusedlayout Smile
You can achieve this already by placing a hidden list in the MyMovieNav.xml...

xml:

<!-- Hidden list for movie sets -->
<control type="list" id="4500">
     <left>-100</left>
     <top>-100</top>
     <width>100</width>
     <height>100</height>
     <itemlayout height="100" width="100" />
     <focusedlayout height="100" width="100" />
     <content sortby="year" sortorder="ascending">videodb://movies/sets/$INFO[ListItem.DBID]/?setid=$INFO[ListItem.DBID]</content>
</control>

... and then using a Container.NumItems infolabel with the respective list ID to show the number of movies in that set:

xml:
$INFO[Container(4500).NumItems]
(2021-10-19, 15:43)Chillbo Wrote: [ -> ]You can achieve this already by placing a hidden list in the MyMovieNav.xml...

xml:

<!-- Hidden list for movie sets -->
<control type="list" id="4500">
     <left>-100</left>
     <top>-100</top>
     <width>100</width>
     <height>100</height>
     <itemlayout height="100" width="100" />
     <focusedlayout height="100" width="100" />
     <content sortby="year" sortorder="ascending">videodb://movies/sets/$INFO[ListItem.DBID]/?setid=$INFO[ListItem.DBID]</content>
</control>

... and then using a Container.NumItems infolabel with the respective list ID to show the number of movies in that set:

xml:
$INFO[Container(4500).NumItems]

Nope, that doesn't work inside an item/focused layout...
Just noticed this now as well... It works with only non-list controls in the respective window present, but not while a list control is used although the set DBID is returned correctly. The hidden list just doesn't seem to be updated while a list control is present - maybe only one list is kept up-to-date per window?
(2021-10-19, 16:45)Chillbo Wrote: [ -> ]Just noticed this now as well... It works with only non-list controls in the respective window present, but not while a list control is used although the set DBID is returned correctly. The hidden list just doesn't seem to be updated while a list control is present - maybe only one list is kept up-to-date per window?

Jurialmunkey has explained this here: https://forum.kodi.tv/showthread.php?tid...pid2853854
Thx for the info! I second this request then. Big Grin

It would also be helpful to get a range of years from a specific movie set (oldest and newest release year of the movies inside the set)...
(2021-10-19, 17:10)Chillbo Wrote: [ -> ]It would also be helpful to get a range of years from a specific movie set (oldest and newest release year of the movies inside the set)...

You are right, that would be cool and you wouldn't need addons for the range of years anymore!
(2021-10-19, 15:55)beatmasterrs Wrote: [ -> ]
(2021-10-19, 15:43)Chillbo Wrote: [ -> ]You can achieve this already by placing a hidden list in the MyMovieNav.xml...

xml:

<!-- Hidden list for movie sets -->
<control type="list" id="4500">
     <left>-100</left>
     <top>-100</top>
     <width>100</width>
     <height>100</height>
     <itemlayout height="100" width="100" />
     <focusedlayout height="100" width="100" />
     <content sortby="year" sortorder="ascending">videodb://movies/sets/$INFO[ListItem.DBID]/?setid=$INFO[ListItem.DBID]</content>
</control>

... and then using a Container.NumItems infolabel with the respective list ID to show the number of movies in that set:

xml:
$INFO[Container(4500).NumItems]

Nope, that doesn't work inside an item/focused layout...

A workaraound is to place another hidden control with a unique id which is able to show

e.g
a hidden button with id 22 with label container(11).numitems
enable = !container(11).isupdating + integer.greater(container(11).numitems,0)

then use
control.getlabel(22) as label in focus layout with visible condidition =
control(22).isenabled


i think it can work.
;-)
Problem is not showing or using the amount of items in that hidden container, but populating the hidden container in the first place. It can't be populated using this, but there's no other way one could do that:

xml:
videodb://movies/sets/$INFO[ListItem.DBID]/?setid=$INFO[ListItem.DBID]
(2021-10-19, 18:03)Chillbo Wrote: [ -> ]Problem is not showing or using the amount of items in that hidden container, but populating the hidden container in the first place. It can't be populated using this, but there's no other way one could do that:

xml:
videodb://movies/sets/$INFO[ListItem.DBID]/?setid=$INFO[ListItem.DBID]

oh.i misunderstood.
thought $INFO[Container(*thesetlink*).Numitems] was the issue in first place.

then for refresh problematic i would think about a variable.

maybe
xml:

<value condition="!String.IsEmpty(Container(11).ListItem.SetId)]">videodb://movies/sets/$INFO[Container.ListItem.setid]/?setid=$INFO[Container.ListItem.setid]</value>
<value condition="String.IsEqual(Container.ListItem.dbtype,set)]">$INFO[Container.ListItem.FolderPath]</value>
<value condition="String.IsEmpty(Container(11).ListItem.SetId)]">empty</value>

even if i am in for such a native label.
We'd need a list filled with the content of that path, but we can't get that to build because the list won't be built using an external  infolabel. AFAICT, there's no other way of getting the number  of all movies in such a list or the range of years of them in any other way. The label for building the list is not the problem (it doesn't matter whether it's variable or an infolabel, both feed on information from the main container, a list) - the list itself is... Sad
(2021-10-20, 10:56)Chillbo Wrote: [ -> ]We'd need a list filled with the content of that path, but we can't get that to build because the list won't be built using an external  infolabel. AFAICT, there's no other way of getting the number  of all movies in such a list or the range of years of them in any other way. The label for building the list is not the problem (it doesn't matter whether it's variable or an infolabel, both feed on information from the main container, a list) - the list itself is... Sad

Got it, i can set the labels, just for the current focused items.
By make this
xml:

<control type="list" id="4444">
            <description>fetch set item - just current focused</description>
            <include>HiddenContainer</include>
            <visible>String.IsEmpty(Window(home).Property(shortcutaction_inprogress))</visible>
            <content sortby="year">$VAR[moviesetcontent]</content>
        </control>
                     <!--
                    <variable name="moviesetcontent">
                       <value condition="String.IsEqual(Container.ListItem.dbtype,set)]">$INFO[Container.ListItem.FolderPath]</value>
                       <value condition="!String.IsEmpty(Container.ListItem.SetId)]">videodb://movies/sets/$INFO[Container.ListItem.setid]/?setid=$INFO[Container.ListItem.setid]</value>
                       <value>-</value>
                    </variable>
                    -->
        <control type="button" id="7777">
            <description>numitems for current focsued</description>
            <enable>Integer.IsGreater(Container(4444).NumItems,0)</enable>
            <label>$INFO[Container(4444).NumItems]</label>
        </control>
        <control type="button" id="7778">
            <description>year last item</description>
            <enable>Integer.IsGreater(Container(4444).NumItems,0)</enable>
            <label>$INFO[Container(4444).ListItem(-1).Year]</label>
        </control>
        <control type="button" id="7779">
            <description>year first set item</description>
            <enable>Integer.IsGreater(Container(4444).NumItems,0)</enable>
            <label>$INFO[Container(4444).ListItem(0).Year]</label>
        </control>

But not for all the unfocused layout items ;-)
Yes, it would be great to have this.  For Amber, I gave up on trying to have that info show inside a itemlayout/focusedlayout, coming from either a hidden container or an addon, it was just not realiably updated.  In the views where I show number of movies in a set, I put that information outside the list/panel, and then it was shown reliably.  In my case, it comes from a hidden container in MyVideoNav.xml.  Like you can see here:

Image


Regards,

Bart
That's exactly what I had done here and it didn't work - a hidden list or fixed list container outside the normal focused layout of the current media view container. I placed it in MyVideoNav.xml, but it never properly updated... What might you be doing differently?
(2021-10-22, 09:46)Chillbo Wrote: [ -> ]That's exactly what I had done here and it didn't work - a hidden list or fixed list container outside the normal focused layout of the current media view container. I placed it in MyVideoNav.xml, but it never properly updated... What might you be doing differently?

As said above, for refreshing use '-' value as fallback


This is my variable (adjusted to)
- where id =503 and 504 ares my viewtype (s)
- i dont like to show it if plugin has filled items, except tv shows

to have it 'refresh' i just add <value>-</value> at bootom , can be something, just have to be empty 'path'.


xml:
<variable name="View_503_Folderpath">
        <value condition="Control.IsVisible(503) + [!String.StartsWith(listitem.path,plugin) + Container.Content(tvshows)]">videodb://tvshows/titles/$INFO[Container(503).ListItem.dbid]</value>
        <value condition="Control.IsVisible(503) + [!String.StartsWith(listitem.path,plugin) + String.IsEqual(Container.ListItem.dbtype,set)]">$INFO[Container.ListItem.FolderPath]</value>
        <value condition="Control.IsVisible(503) + [!String.StartsWith(listitem.path,plugin) + !String.IsEmpty(Container.ListItem.SetId)]">videodb://movies/sets/$INFO[Container.ListItem.setid]/?setid=$INFO[Container.ListItem.setid]</value>
        <value condition="Control.IsVisible(504) + [!String.StartsWith(listitem.path,plugin) + Container.Content(tvshows)]">videodb://tvshows/titles/$INFO[Container(504).ListItem.dbid]</value>
        <value condition="Control.IsVisible(504) + [!String.StartsWith(listitem.path,plugin) + String.IsEqual(Container.ListItem.dbtype,set)]">$INFO[Container.ListItem.FolderPath]</value>
        <value condition="Control.IsVisible(504) + [!String.StartsWith(listitem.path,plugin) + !String.IsEmpty(Container.ListItem.SetId)]">videodb://movies/sets/$INFO[Container.ListItem.setid]/?setid=$INFO[Container.ListItem.setid]</value>
        <value condition="String.StartsWith(listitem.path,plugin) + String.IsEqual(Container.ListItem.dbtype,tvshow)">$INFO[Container.ListItem.FolderPath]</value>
        <value>-</value>
    </variable>

Than outside of List
$INFO[Container(50352).NumItems]


where 50352 is a container ,which using $VAR[View_503_Folderpath] in the content tag


-- PS Cleaner code xample abvove

for proof ia dd vid ,check orange label, refresh time sucks, but only working method
https://streamable.com/vsag55
Pages: 1 2