Kodi Community Forum

Full Version: Add real video width and height to listitem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Would it be possible to add the real movie width and height from database fields ivideowidth and ivideoheight as properties to ListItem?

Just take them from the first video stream.

The code in script.globalsearch already has the local variables for them (to determine the videoresolution property)

videowidth = item['streamdetails']['video'][0]['width']
videoheight = item['streamdetails']['video'][0]['height']

So, at the end, just add:

listitem.setProperty( "videowidth", videowidth )
listitem.setProperty( "videoheight", videoheight )

This would really help out in my skin modifications.

Greetings,

Hablaras
is this request specific to the globalsearch addon only, or kodi in general?
i don't think kodi exposes those infolabels when you're browsing your video library?

how do you intent to make use of this info in your skin?
Hi Ronie,

> is this request specific to the globalsearch addon only, or kodi in general?

Sorry, to Kodi in general. I assumed that addon took care of adding properties to the ListItem object you can use in skins. I guess I am mistaken. How does the ListObject get populated? Is that in the core C code of Kodi?

> i don't think kodi exposes those infolabels when you're browsing your video library?

No, it doesn't.

These return nothing:
ListItem.width
ListItem.videowidth
ListItem.ivideowidth

> how do you intent to make use of this info in your skin?

When pressing "i" for info, I want to add it there. In my case, I use skin "Eminence 2 Mod", but it could be any skin really. Besides the video resolution and icons there, I also added more technical info like the file path and a label with the real width and height... but that is now empty.

Some background info: some of my movies have 800 horizontal lines, so get resolution "1080p" and the icon for "1080p". But I want to display the real "1920x800" value on the information window.
yes, it's handled in core by kodi.

i don't think it would be too difficult to add ListItem.VideoWidth / ListItem.VideoHeight infolabels...

i'll move this thread to skin dev to see if there's interest in this from other skinners as well.
If it can not be easy added to Kodi core code I think I can add this in skinhelper because the json api returns the actual values... Could be a quick workaround for now untill handled in Kodi core.
Hi Marcel,

That would be nice!

To be complete: I also looked at your skinhelper, because the Eminence 2 MOD uses it, but could not find it.

Thanks!
(2016-02-16, 14:06)Hablaras Wrote: [ -> ]That would be nice!

Latest git version of the script has these properties included:

Window(Home).Property(SkinHelper.ListItemVideoWidth)

and

Window(Home).Property(SkinHelper.ListItemVideoHeight)
Thanks Marcel,

After tinkering with it for an hour and testing with posts to the jsonrpc service to check it does indeed return the width and height... I found that I needed to delete the cache file once:

..\Kodi\userdata\addon_data\script.skin.helper.service\librarycache.json

Now it works perfectly!
(2016-02-17, 22:07)Hablaras Wrote: [ -> ]After tinkering with it for an hour and testing with posts to the jsonrpc service to check it does indeed return the width and height... I found that I needed to delete the cache file once:
Now it works perfectly!
Sorry, forgot to mention that Angel

Glad you solved it