Video addon assistance querying artist information
#1
To start off I will say that I am new to Kodi addon development but have some Python experience.  I am working on an existing addon that was developed by another developer I am working with.,  It is a video addon which works against a uPNP server with an Sqlite backend.  It is working perfectly but I am looking to add some functionality but need pointed in the right direction.  I am still learning Kodi windows, skins etc. 
The additional functionality involves querying the uPNP server for a list of movies that a particular actor / actress stars in.  The existing addon has a search capability that works fine when a user enters the name (or part of a name) into the search dialog.  What I am trying to enhance is in the video info / details window.  The info / details window has an artists button which then lists then from the uPNP Sqlite database but when you click on an individual artist it searches the Kodi internal database vs. wanting to direct it to the uPNP backend.  I am sure I can leverage the existing addon search code and pass it the artist info but I need to understand whether I can override Kodi functionality to query the internal database and call the existing addon search function with the artist name that the user clicks on.
I haven’t found Kodi documentation on exactly how to do this and does it vary across skins.  I am hoping someone can point me in the right direction.  Thanks in advance.
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#2
I dug through the code more and found where the Info window is being created.  You can see that artists is simply parsing a list from the uPNP server and when you click on artists it brings up what looks like a Kodi function that displays the artists at the bottom of the info window.   Then when you click on an artist it calls to the Kodi database to search for artists.  It is this behavior I want to try and change.

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,
                    }
                    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})
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#3
From what I have been able to learn so far I believe the XBMC.Action(Info) function can only be passed a string for each of the elements (i.e. 'artist': artist_text.split(','),) .  I haven't found where instead of the artist element displaying a list of strings that correspond to the actor list for a movie that I could instead have it call a function which could even display a new window I create which could list the actors and then allow the user to click on them and launch the search function I already have wiitten.

I did find this callback function capability which looks like it might work.  I've determined that the local ID is 557 for the Artist button in the DialogVideoInfo skin file.

<item>
           <label>$LOCALIZE[557]:</label>
           <label2>$INFO[ListItem.Artist]</label2>
            <visible>!String.IsEmpty(ListItem.Artist)</visible>
</item>

I am thinking I can use the OnClick callback function, grab the $INFO from ID 557 and then call my search function. 

Is this a reasonable / achievable approach and within Kodi guidelines ?
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Video addon assistance querying artist information0