DisplayVideoInfo.xml Update Actor Image control
#1
I have a video add-on that calls DisplayVideoInfo.xml via a context menu add command:

li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])

I am having difficulty passing the image info (in this case I am testing with the Confluence skin) to the Actor image control in the DisplayVideoInfo.xml file.  Specifically:

              <control type="image">
                    <description>Actor image</description>
                    <left>210</left>
                    <top>480</top>
                    <width>160</width>
                    <height>160</height>
                    <texture>$INFO[Container(50).Listitem.Icon]</texture>
                    <aspectratio>keep</aspectratio>
                    <visible>Control.IsVisible(50)</visible>
                </control>

If I change the texture parameter to a hard coded file name I get the image so I know the basic skin functionality is working as I want.  I am passing the DisplayVideoInfo.xml the rest of the parameters in the video info window just fine via the following code in my add-on:

if mediaClass_text == 'video':  
                    li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])
                    
                    info = {
#                        'id': '1234',
                        'duration': getSeconds(duration_text),
                        'genre': genre_text,
                        'year': release_year_text,
                        'title': title,
                        'plot': description_text,
                        'director': creator_text,
                        'tagline': tagline_text,
                        'writer': writer_text,
                        'cast': artist_text.split(','),
                        'artist': artist_text.split(','),
                        'rating': rating_val,
                        'code': imdb_text,
                        'mediatype': categories_text.split(','),
                        'season': season_text,
                        'episode': episode_text,
                        'lastplayed': lastplayed_text,
                        'aired': aired_text,
                        'mpaa':content_rating_text,
                        'playcount':playcount,
                        'trailer':trailerurl,
                        'icon':'d:\gbutler.jpg',
                    }
                    li.setInfo(mediaClass_text, info)
                    li.setProperty('ResumeTime', dcmInfo_text)
                    li.setProperty('TotalTime', str(getSeconds(duration_text)))
                    video_info = {
                        'codec': video_codec_text,
                        'aspect': aspect,
                        'width': video_width,
                        'height': video_height,
                    }
                    li.addStreamInfo('video', video_info)
                    li.addStreamInfo('audio', {'codec': audio_codec_text, 'language': audio_lang, 'channels': int(audio_channels_text)})
                    li.addStreamInfo('subtitle', {'language': subtitle_lang})


I tried hard coding the red text above for testing  but passing the icon variable is not supported this way according to: http://mirrors.kodi.tv/docs/python-docs/...em-setInfo
 
And the logs confirm it:

2020-03-26 19:51:47.544 T:34480   ERROR: NEWADDON Unknown Video Info Key "icon"

Can someone point me in the right direction here ?  I want to pass a list of URLs which point to files on my uPNP server to populate the  <texture>$INFO[Container(50).Listitem.Icon]</texture> skin element.  I know I am missing something simple here but just can't see it.

Thanks in advance,

Jeff
Reply
#2
you need to pass the list of actors (name/role/icon) to kodi using the ListItem.setCast() method:
https://codedocs.xyz/xbmc/xbmc/group__py...fb7ccd3619

... moving this to python develoment
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thank you so much.  That is the solution and I've already got it coded and working.  I am running into one problem and am wondering what the recommended practice is for solving.  I am somewhat new to Kodi development.  The problem I am trying to solve is that there are times where I will query actor thumbnails from the uPNP server but I don't have a thumbnail image yet in the server database.  When that occurs the uPNP server sends back a generic thumbnail image vs. the real actor image.  Kodi then stores this in the textures database for caching.  If I then update the image on the uPNP server it starts sending it back but Kodi continues to look at the textures database.  Does Kodi have a caching timer and will eventually update it's database or do I need to figure out another solution ?   Since the skin code is getting the URL response I can't try and catch the generic image.  Looking for some direction here.

Thanks in advance
Reply
#4
I've been doing some reading and caching incorrect images into the texture database seems to be a common problem with scrapers and such, where there are utilities out to manage or you can blow away the textures database.  I am not going to try and solve this right now.  I do have one other major Kodi skin functionality question (I know I am probably over my limit already) which is the key on whether all this work or whether it will end up being a waste of time. 

In the DisplayVideoInfo.xml file that creates the Video Info dialog window I want to override the functionality when you click on a cast member not to query the Kodi database but instead query my uPNP database for a list of movies the cast member stars in.  I already have the uPNP add-on function written to create the new window with the list of movies but am looking for how I override the functionality calling the Kodi database.  

I found the onClick method https://codedocs.xyz/xbmc/xbmc/group__py...aa78bcc4ef which I think might work.  If so, I need to figure out how to grab the control ID from the control and how to call the method.  It seems to indicate that Kodi will call it automatically.   

This is the last step .  If I get this working I am fully functional with the add-on.

Can someone with more skinning and Python knowledge weigh in here ?

 

Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
DisplayVideoInfo.xml Update Actor Image control00
This forum uses Lukasz Tkacz MyBB addons.