Kodi Community Forum

Full Version: Count of movies in a movieset?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

is there a way, to show count of movies in a movieset on a listcontrol? Undecided
(2019-04-30, 09:12)beatmasterrs Wrote: [ -> ]Hi,

is there a way, to show count of movies in a movieset on a listcontrol? Undecided

I guess you're looking for:
Code:
SkinHelper.ListItem.UnwatchedCount / SkinHelper.ListItem.Count
Using SH, like in here: https://github.com/cartmandos/skin.titan...s.xml#L998

I think without json query with set id you can't get it outside set-level view (don't know if there's an infolabel there as well but probably could use one of the total items num info)
(2019-04-30, 09:12)beatmasterrs Wrote: [ -> ]is there a way, to show count of movies in a movieset
Yes, but unfortunately only the SkinHelper code as described by @cartman.dos .
It is unfortunately very slow and may be that it works worse without Internet connection as with (for whatever reason that behavior is on my side)
I hope so in the next Kodi 19 Matrix (not the Reeves Neo Matrix, the Arnie Commando Matrix) gets in Kodi core.
(2019-05-01, 00:27)chrissix Wrote: [ -> ]
(2019-04-30, 09:12)beatmasterrs Wrote: [ -> ]is there a way, to show count of movies in a movieset
Yes, but unfortunately only the SkinHelper code as described by @cartman.dos .
It is unfortunately very slow and may be that it works worse without Internet connection as with (for whatever reason that behavior is on my side)
I hope so in the next Kodi 19 Matrix (not the Reeves Neo Matrix, the Arnie Commando Matrix) gets in Kodi core. 

Specifically this infos aren't supplied by webservice, they're simple python count calcs, so no internet involved. But SH is slow as whole since it's doing A LOT of background stuff.

So if your skin already is using SH, then just use these props, otherwise think of another workaround.
A service add-on dedicated for this is one way, but you could try making an hidden container with content of the set and then try pull data from the container.
I guess it'd be something like:
Code:
<content>videodb://movies/sets/$INFO[ListItem.SetID]</content>
Try putting this code in your view...
xml:
                <control type="list" id="59555">
                    <left>-1000</left>
                    <top>-1000</top>
                    <visible>ListItem.IsCollection</visible>
                    <itemlayout />
                    <focusedlayout />
                    <content>$INFO[ListItem.FolderPath]</content>
                </control>

...after that 
xml:
$INFO[Container(59555).NumItems] 
will give you the number of movies in the movieset
Thanks for your replies, I will try that, when I'm back home Smile
Okay, this is working. Now I can show the number of movies from a focused movie set outside a list item with a label, but not inside a list itself. It would be cool if I could also display the number in the list itself. But actually the number is not correct. Only the number from the last movie set entered is displayed correctly.

xml:

<control type="group">
 <control type="list" id="59555">
  <left>-1000</left>
  <top>-1000</top>
  <visible>ListItem.IsCollection</visible>
  <itemlayout />
  <focusedlayout />
  <content>$INFO[ListItem.FolderPath]</content>
 </control>
 <control type="label" id="19124" description="debug">
  <top>0</top>
  <right>100</right>
  <width>500</width>
  <aligny>center</aligny>
  <height>64</height>
  <align>right</align>
  <font>SmallNavi</font>
  <textcolor>Dark1</textcolor>
  <selectedcolor>Dark1</selectedcolor>
  <label>$INFO[Container(59555).NumItems]</label>
  <visible>ListItem.IsCollection</visible>
 </control>
 <control type="list" id="50">
  <top>PosterPad</top>
  <height>PosterH</height>
  <left>ListX</left>
  <right>SidePad</right>
  <onleft condition="!Skin.HasSetting(global.kioskmode)">9000</onleft>
  <onright>1627</onright>
  <onup>50</onup>
  <ondown>50</ondown>
  <pagecontrol>1627</pagecontrol>
  <viewtype label="535">list</viewtype>
  <scrolltime tween="quadratic">400</scrolltime>
 
  <itemlayout condition="Skin.HasSetting(511ListInfo)" width="ListW" height="91">
   <control type="group">
    <control type="label">
     <top>28</top>
     <posx>30</posx>
     <width>auto</width>
     <aligny>center</aligny>
     <height>64</height>
     <font>Small24</font>
     <label>$INFO[Container(59555).NumItems]</label>
     <textcolor>Dark2</textcolor>
     <selectedcolor>Dark1</selectedcolor>
    </control>
    <control type="label">
     <top>28</top>
     <posx>30</posx>
     <width>auto</width>
     <aligny>center</aligny>
     <height>64</height>
     <font>Small24</font>
     <label>$INFO[Control.GetLabel(19124)]</label>
     <textcolor>Dark2</textcolor>
     <selectedcolor>Dark1</selectedcolor>
    </control>
   </control>
  </itemlayout>

  <focusedlayout width="ListW" height="91" condition="Skin.HasSetting(511ListInfo)">
   <control type="group">
    <control type="label">
     <top>28</top>
     <posx>30</posx>
     <width>auto</width>
     <aligny>center</aligny>
     <height>64</height>
     <font>Small24</font>
     <label>$INFO[Container(59555).NumItems]</label>
     <textcolor>Dark2</textcolor>
     <selectedcolor>Dark1</selectedcolor>
    </control>
    <control type="label">
     <top>28</top>
     <posx>30</posx>
     <width>auto</width>
     <aligny>center</aligny>
     <height>64</height>
     <font>Small24</font>
     <label>$INFO[Control.GetLabel(19124)]</label>
     <textcolor>Dark2</textcolor>
     <selectedcolor>Dark1</selectedcolor>
    </control>
   </control>
  </focusedlayout>
 </control>
</Control>


Why it isn't possible to show the count on the focusedlayout with
xml:
<label>$INFO[Control.GetLabel(19124)]</label>
? In the label itself outside the list, the count is displayed correctly...
Accessing external infolabels from a list control never works properly. For performance reasons, list controls are limited to using infolabels only from listitems.

To use an external label inside the list, you would need to recreate the list as a grouplist (i.e. like how coverflow views are done).

I have managed to get external labels into a list using static items, but that's the closest I've come. You can see it in action in AZ2's decade hub:
https://github.com/jurialmunkey/skin.arc...de_Hub.xml
(2019-05-12, 02:13)jurialmunkey Wrote: [ -> ]Accessing external infolabels from a list control never works properly. For performance reasons, list controls are limited to using infolabels only from listitems.

To use an external label inside the list, you would need to recreate the list as a grouplist (i.e. like how coverflow views are done).

I have managed to get external labels into a list using static items, but that's the closest I've come. You can see it in action in AZ2's decade hub:
https://github.com/jurialmunkey/skin.arc...de_Hub.xml

Thanks a lot for your example. I'll take a closer look. Smile