v18 Skinning - Any way to show a count of movies inside a movie set??
#1
Hi,

I am not a skinner but have modded some existing skins over the years for personal use only.

I'm struggling with how to show a count of movies inside a movie set on a skin.  I have a list view that shows all movie entries. The entry might be a single movie or a movie set. If it is a movie set I would like to show a number to the right of that entry showing how many movies are inside that set.

I can determine if the entry on the list is a set or not by using the boolean condition "ListItem.IsCollection" which is true for a movie set. However, I can't find a way of showing how many movies are in that set.

I've tried the following 2 methods, the first one shows the number of items on the actual list rather than the number of items in that set and the second method shows nothing. I'm showing the movie year if it's not part of a set (that works fine), and want to show the count of movies in a set if it is a movie set.

<variable name="MovieSet">
        <value condition="!ListItem.IsCollection">$INFO[ListItem.Year]</value>
        <value condition="ListItem.IsCollection">$INFO[Container.NumItems]</value>
</variable>   

<variable name="MovieSet">
         <value condition="!ListItem.IsCollection">$INFO[ListItem.Year]</value>
         <value condition="ListItem.IsCollection">$INFO[Window(Home).Property(SkinHelper.ListItem.Count)]</value>
</variable>   

Does anybody know how to achieve this? Is it even possible?

Many thanks in advance for looking.
Reply
#2
Put this in the xml of the movie view (not in variables):

                <control type="fixedlist" id="59030">
                    <visible>ListItem.IsCollection</visible>
                    <itemlayout>
                    </itemlayout>
                    <focusedlayout>
                    </focusedlayout>
                    <content sortby="year" sortorder="ascending">$INFO[ListItem.FolderPath]</content>
                </control>

After that you can use...

$INFO[Container(59030).NumItems]

...to show the number of movies of the set.
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#3
(2020-03-05, 01:27)manfeed Wrote: Put this in the xml of the movie view (not in variables):

                <control type="fixedlist" id="59030">
                    <visible>ListItem.IsCollection</visible>
                    <itemlayout>
                    </itemlayout>
                    <focusedlayout>
                    </focusedlayout>
                    <content sortby="year" sortorder="ascending">$INFO[ListItem.FolderPath]</content>
                </control>

After that you can use...

$INFO[Container(59030).NumItems]

...to show the number of movies of the set.
Wow!

Thanks so much for your very quick response. I did what you suggested and it has definitely improved. Please look at picture below:-
The list is now showing a count for movies in a set and a year for single movies, but it is not always an accurate count of movies. Also, the number can change if you page up and down over the entries or if you go into a set and then come back out again the number is then corrected but other entries are made incorrect. It's really strange.

https://mega.nz/#!DhIxyQbI!O5XbcX4nZIINx...DvttBHXDZ4

I've also uploaded the two xmls I modded - a variables.xml and rightlist.xml:-
Variables.xml
https://mega.nz/#!ixIBBYwI!iGsfBbPkodNCZ...j3pIAS-Fvs

RightList.xml
https://mega.nz/#!uoYnnYJC!IsYoKH0H0N9aZ...PX-Gy1b-A0

I modded rightlist.xml by inserting your suggested code at the top of the xml file and using variable "MovieSet". In the variables.xml, I am setting the variable "MovieSet" to display either year or number of movies in set.

Any further advice much appreciated and thanks so much again!
Reply
#4
Forget about using variables for this, try this way...

https://mega.nz/#!l8MFSISC!wen0ZBFgBlq38...ytsHXTvN-U

...some additional advice if you want to go ahead in modding/skinning; don't use this section, post in SKINNING section instead. Also, instead of asking right away, look for a skin that already does what you want to get, and and try to see how it does it; at the end of the day that's one of the advantages of the free software, the code is available to everyone. That way you will learn faster. Good luck!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#5
(2020-03-05, 10:51)manfeed Wrote: Forget about using variables for this, try this way...

https://mega.nz/#!l8MFSISC!wen0ZBFgBlq38...ytsHXTvN-U

...some additional advice if you want to go ahead in modding/skinning; don't use this section, post in SKINNING section instead. Also, instead of asking right away, look for a skin that already does what you want to get, and and try to see how it does it; at the end of the day that's one of the advantages of the free software, the code is available to everyone. That way you will learn faster. Good luck!
Got it working!

First, I tried using marcelveldts "skin.helper.service" addon and using the "SkinHelper.ListItem.Count" value but that had the same issue as before - ie random numbers appearing on the list. So, I moved the value "$INFO[Container(59030).NumItems]" away from the list (itemlayout and focusedlayout sections) and just added it to show next to the poster view.
I chose your method as it loads the value much faster than the "skin.helper.service" method.

The change I made is shown below and I like it much more than before. I show the count just next to the poster. In the list, the default for sets was to show the year of the most recent entry for the set. Instead I now put the word "SET". Smile

View is below - case closed and thanks for your help! Without it, this would never have been accomplished!!  I normally do try to figure these things out for myself using the existing code in various skins - just that I've never seen a count of movies in a set in a skin and still don't know of any.

https://mega.nz/#!f0gHELqS!Qkcg6mibWhCcN...A7nJTPGp5Q
Reply
#6
(2020-03-05, 17:48)ukmark62 Wrote: I normally do try to figure these things out for myself using the existing code in various skins - just that I've never seen a count of movies in a set in a skin and still don't know of any.

It seems that Aeon Tajo skin is not very popular... Rofl
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#7
@manfeed
The above works perfectly for the total movie count, but I've been trying work out how I can nail down on the total number of movies within a set that have a play count greater than 0, ie watched. Unfortunately, everything I've tried so far has failed.  Sad
I downloaded your skin, hoping you might show this info for sets, but seems you show a watched flag if all the movies within a set have been watched.
Do you think what I'm trying to achieve is actually possible, because I'm getting serious brain ache trying to figure it out!  Tongue
Any thoughts / feedback would be much appreciated.
Cheers
Reply
#8
First off, I saw your post just by chance, it seems that @ + name of the user doesn't work in the forum anymore... I don't know how to do what you ask for, only thing that I can think of is using skinvariables script, from jurialmunkey. Here you can find more info...

https://github.com/jurialmunkey/script.s...irectories

Anyway, I think that this kind of posts belong to the Skinning section, there you'll find more people willing to help.
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#9
(2024-07-12, 14:57)Dumyat Wrote: The above works perfectly for the total movie count, but I've been trying work out how I can nail down on the total number of movies within a set that have a play count greater than 0, ie watched. Unfortunately, everything I've tried so far has failed.  Sad
I downloaded your skin, hoping you might show this info for sets, but seems you show a watched flag if all the movies within a set have been watched.
Do you think what I'm trying to achieve is actually possible, because I'm getting serious brain ache trying to figure it out!  Tongue
Any thoughts / feedback would be much appreciated.
Cheers

Since you also use SHS in your skin, here is a simple solution with SHS.

xml:
<value condition="String.Contains(ListItem.Path,videodb://movies/sets/)">$INFO[Window(Home).Property(SkinHelper.ContentHeader)]$INFO[Window(Home).Property(SkinHelper.ListItem.Count), • , $LOCALIZE[342]]$INFO[Window(Home).Property(SkinHelper.ListItem.UnWatchedCount), • , $LOCALIZE[16101]]$INFO[Window(Home).Property(SkinHelper.ListItem.WatchedCount), • , $LOCALIZE[16102]]</value>

Here is the result:

Image

Image
Reply
#10
(2024-07-12, 23:42)manfeed Wrote: Anyway, I think that this kind of posts belong to the Skinning section, there you'll find more people willing to help.
Okay, thanks.
Reply
#11
(2024-07-13, 00:07)Fuchs2468 Wrote:
(2024-07-12, 14:57)Dumyat Wrote: The above works perfectly for the total movie count, but I've been trying work out how I can nail down on the total number of movies within a set that have a play count greater than 0, ie watched. Unfortunately, everything I've tried so far has failed.  Sad
I downloaded your skin, hoping you might show this info for sets, but seems you show a watched flag if all the movies within a set have been watched.
Do you think what I'm trying to achieve is actually possible, because I'm getting serious brain ache trying to figure it out!  Tongue
Any thoughts / feedback would be much appreciated.
Cheers
Since you also use SHS in your skin, here is a simple solution with SHS.

xml:
<value condition="String.Contains(ListItem.Path,videodb://movies/sets/)">$INFO[Window(Home).Property(SkinHelper.ContentHeader)]$INFO[Window(Home).Property(SkinHelper.ListItem.Count), • , $LOCALIZE[342]]$INFO[Window(Home).Property(SkinHelper.ListItem.UnWatchedCount), • , $LOCALIZE[16101]]$INFO[Window(Home).Property(SkinHelper.ListItem.WatchedCount), • , $LOCALIZE[16102]]</value>
Ok, great. I will give your code a try.
When I tried the SHS watched count a couple of days ago, I was getting totally random results returned in most cases. In fact, in some instances it was showing I had watched more movies than the set actually contained. 
Thx
Reply
#12
(2024-07-13, 01:08)Dumyat Wrote:
(2024-07-12, 23:42)manfeed Wrote: Anyway, I think that this kind of posts belong to the Skinning section, there you'll find more people willing to help.
Okay, thanks.
Thread moved.
Reply
#13
(2024-07-13, 01:19)Dumyat Wrote: Ok, great. I will give your code a try.

I tested my code in your skin today.
Here is an optimization for your skin.
It works perfectly, all values ​​are correct.
The John Wick movie set is also correct. I have 2 movies in my Kodi database and 5 movies are listed in the TMDB database.
Tested in:
- <variable name="PlotTextBoxVar">
- <variable name="ShiftRightTextBoxVar">

xml:
<value condition="System.HasAddon(script.skin.helper.service) + System.AddonIsEnabled(script.skin.helper.service) + !ListItem.IsParentFolder + String.Contains(ListItem.Path,videodb://movies/sets/)">[COLOR button_focus]$INFO[Container.NumItems,, $LOCALIZE[20434]]$INFO[Window(Home).Property(SkinHelper.ListItem.Count), • ,]$INFO[Window(Home).Property(SkinHelper.ListItem.Totalmovies),/, $LOCALIZE[342]]$INFO[Window(Home).Property(SkinHelper.ListItem.UnWatchedCount), • , $LOCALIZE[16101]]$INFO[Window(Home).Property(SkinHelper.ListItem.WatchedCount), • , $LOCALIZE[16102]][/COLOR][CR]$INFO[ListItem.Plot]</value>

Kodi setting "Include sets containing a single movie" should be deactivated to give better results.

look here:

ImageImage

ImageImage
Reply
#14
(2024-07-14, 02:01)Fuchs2468 Wrote:
(2024-07-13, 01:19)Dumyat Wrote: Ok, great. I will give your code a try.
I tested my code in your skin today.
Here is an optimization for your skin.
It works perfectly, all values ​​are correct.

xml:
<value condition="System.HasAddon(script.skin.helper.service) + System.AddonIsEnabled(script.skin.helper.service) + !ListItem.IsParentFolder + String.Contains(ListItem.Path,videodb://movies/sets/)">[COLOR button_focus]$INFO[Container.NumItems,, $LOCALIZE[20434]]$INFO[Window(Home).Property(SkinHelper.ListItem.Count), • ,]$INFO[Window(Home).Property(SkinHelper.ListItem.Totalmovies),/, $LOCALIZE[342]]$INFO[Window(Home).Property(SkinHelper.ListItem.UnWatchedCount), • , $LOCALIZE[16101]]$INFO[Window(Home).Property(SkinHelper.ListItem.WatchedCount), • , $LOCALIZE[16102]][/COLOR][CR]$INFO[ListItem.Plot]</value>
The good news is this updated code is returning much better results for the watched count.
Unfortunately, I'm still getting some rogue results being returned of some sets. On the face of it, these seem to be sets that I have opened within the last week or so and updated the watched status manually on quite a lot of movies via the context menu, as I have been working my way through my movie set collections, updating the artwork. It would seem these updates of the movie status I have made are not being reflected by the the SHS.

Are you able to test this as well, ie change the status of an un-watched movie to watched within one of your movie sets and see if the total watched count then increases? If you do see the same thing happening, what would be the best way to clear the skin helper data just for the movie sets?
Again, your input is very much appreciated.
Thx
Reply
#15
(2024-07-14, 09:41)Dumyat Wrote: Are you able to test this as well, ie change the status of an un-watched movie to watched within one of your movie sets and see if the total watched count then increases? If you do see the same thing happening, what would be the best way to clear the skin helper data just for the movie sets?
Again, your input is very much appreciated.

I found the problem, some time ago caching was added to script.module.metadatautils by SHS.
I don't think the original author intended this. Because it prevents the data from being updated quickly.
Here is my simple and quick solution.

Go to:
\addons\script.module.metadatautils\lib\metadatautils.py
Line 128 there you will find this:
Python:
    @use_cache(90)
    def get_moviesetdetails(self, title, set_id):
        '''get a nicely formatted dict of the movieset details which we can for example set as window props'''

Delete line 128 with @use_cache(90).
It should then look like this.
Python:
    def get_moviesetdetails(self, title, set_id):
        '''get a nicely formatted dict of the movieset details which we can for example set as window props'''

Now you should always receive all changes in the watched and unwatched status immediately.
Reply

Logout Mark Read Team Forum Stats Members Help
Skinning - Any way to show a count of movies inside a movie set??0